0👍
In your options, use this:
scaleBeginAtZero : false,
scaleOverride: true,
scaleStartValue: 1,
Try this for your php code:
private function _create_uncontinuousline_chart( $data, $opt ){
if ( empty( $data ) ){
return '';
}
$id = self::_get_canvas_id( $this->count );
$sets = self::_parse_data( $data, 3 );
$cd = self::_resort_sets( $sets, true );
$this->js[] = 'new Chart(' . "jQuery('#$id').get(0).getContext('2d')" . ')
.UncontinuousLine(' . AimyChartsContentPluginHelper::phpva_json_encode( $cd ) . ','
. '{' . 'animation: ' . ( $opt[ 'animate' ] ? 'true' : 'false' )
. ',multiTooltipTemplate: ' . '"<%= value %> (<%= datasetLabel %>)"'
. ',responsive: ' . ( $opt[ 'responsive' ] ? 'true' : 'false' )
. ',datasetStrokeWidth:0.01'
. ',scaleBeginAtZero : false'
. ',scaleOverride: true'
. ',scaleStartValue: 1'
. '}' . ');';
return self::_get_canvas( 'UncontinuousLine', $this->count, $opt );
- Chartjs-Chart.js not showing all labels on pie chart
- Chartjs-ChartKick – ChartJs – Legend onClick override with default behaviour
Source:stackexchange.com