How to add highchart in angular 5

Highchart is an popular libary to implement charts in your application. Highcharts comes with both personal and commercial version.

Users can purchase based on needs.

Here the steps to implement in Angular 5 Application.

Step 1:

# install angular-highcharts and highcharts
npm i --save angular-highcharts highcharts

# install highcharts typings
npm i --save-dev @types/highcharts

Step 2:

// app.module.ts
import { ChartModule } from 'angular-highcharts';</code>

@NgModule({
imports: [
ChartModule // add ChartModule to your imports
]
})
export class AppModule {} 

Step 3:


// chart.component.ts
import { Chart } from 'angular-highcharts';

@Component({
  template: `
    <button (click)="add()">Add Point!</button>
    <div [chart]="chart"></div>
  `
})
export class ChartComponent {
  chart = new Chart({
    chart: {
      type: 'line'
    },
    title: {
      text: 'Linechart'
    },
    credits: {
      enabled: false
    },
    series: [
      {
        name: 'Line 1',
        data: [1, 2, 3]
      }
    ]
  });

  // add point to chart serie
  add() {
    this.chart.addPoint(Math.floor(Math.random() * 10));
  }
}

More Information: github.com

Music with Android Auto

Android Auto is still not a feature that is available in most car entertainment systems. Even those with this feature in their car might not have used it extensively. It does a good way of utilizing your phone and display useful apps in the car entertainment system. Best of all is it is integrated with google assistant using which you can issue handsfree commands to your Car head unit. Cool isn’t it.

I have been using Android Auto extensively for past 1 year. One of my biggest gripes on Android auto being not able to identify good audio apps that support Android Auto. Android Auto app lists very few music players through the app store, and most of the apps listed there are either music streaming apps or podcast apps. After a brief search found out this reddit page. So here a short review of all the music players I have tried and the final verdict one I love using.

Play music is one default app that will be installed by default on your phone when you enable android auto. Here most of the importance is given to streaming content than the music available in the phone. You will have to create playlists to play music from the phone. Play music has an added advantage over other players here. It supports searching and playing your audio library through voice command. Simply press command button and say “Play <insert your song name> song” it would play from your library if available¬† else from online.

JetAudio

A well known name in audio players. A good enough player for android auto but not for personal use, I found the ads too distracting in the free version.

Rocket Player

A good android auto music player which I have used for sometime. But the controls in in the android auto seemed very minimal, especially in the sidebar. Other than that this is a good player.

MD Player

I used this player quite extensively, has a good play all music mode. But the shuffle is not that great, always tend to repeat the songs rather than finding fresh one from local library. Side menu can have better controls.

Cloud player

For a moment I thought I found the perfect music player for my needs. But the interface was bit slow. Has a good shuffle mode that helps me during travel. Worst thing about this player is, it starts on its own at random times. Uninstalled after few days.

AnyAutoAudio

This should have been default option in Android auto. This enables playing audio through any of your favourite music player and connect with android auto. Has its own issues. The audio output was too low to my liking. Music browsing was almost not there, you have to use your phone to scroll. This is not available in play store though.

Musicolet

Surprise player which satisfies all my requirements. Has a good shuffle mode, can hold multiple lists, surprisingly lightweight and best of all no Ads. This is my goto player for android auto nowdays.

I have my own gripes with android auto in general. I has very hard to browse interface, which requires browsing through side menu. Searching this way is pain. You need good internet connectivity to use google assistant efficiently. Some time I tend to fall back to good old bluetooth when not using assistant features or the google map. All in all I still like Android auto for the handsfree experience and google maps handsdown.

Custom templates not showing up in template dropdown in WordPress 4.9

In wordpress there is a bug. When you create new custom template and search in backend dropdown you are not able to view custom template name in WordPress. Needs to wait until clears the bug.

Simple solution below

update below code in functions.php

function wp_42573_fix_template_caching( WP_Screen $current_screen ) {
	// Only flush the file cache with each request to post list table, edit post screen, or theme editor.
	if ( ! in_array( $current_screen->base, array( 'post', 'edit', 'theme-editor' ), true ) ) {
		return;
	}
	$theme = wp_get_theme();
	if ( ! $theme ) {
		return;
	}
	$cache_hash = md5( $theme->get_theme_root() . '/' . $theme->get_stylesheet() );
	$label = sanitize_key( 'files_' . $cache_hash . '-' . $theme->get( 'Version' ) );
	$transient_key = substr( $label, 0, 29 ) . md5( $label );
	delete_transient( $transient_key );
}
add_action( 'current_screen', 'wp_42573_fix_template_caching' );

More Info – https://core.trac.wordpress.org/ticket/42573