Show fraction values ​​in highchart

On the vertical Y-axis, I want to show some fraction values ​​like 100/50, 100/70 100/90

Is it possible? please help me how to show these values.

$.getJSON('1.php?ID=' + <?php echo $Id; ?>, function(json) {
		  $('#container').highcharts({
	            chart: {
	                renderTo: 'container',
	                type: 'spline',
					animation: Highcharts.svg,
	                marginRight: 130,
	                marginBottom: 25,
				
	            },
	            title: {
	                text: 'Lab',
	                x: -20 //center
	            },
	            subtitle: {
	                text: '',
	                x: -20
	            },
				xAxis: {
				    type: 'time',
					tickPixelInterval: 007
				},
	            yAxis: {
	                title: {
	                    text: 'Lab'
	                },
	                plotLines: [{
	                    value: 0,
	                    width: 1,
	                    color: '#808080'
	                }]
	            },
	            
	            legend: {
	                layout: 'vertical',
	                align: 'right',
	                verticalAlign: 'top',
	                x: -10,
	                y: 100,
	                borderWidth: 0
	            },
				exporting: {
					enabled: true
				},
	           series: [{
                                        name: 'Lab',
                                        data: json.data,
                                        datataLabels: {
                                             enabled: true,
                                             rotation: -90,
                                             color: '#FFFFFF',
                                            align: 'right',
                                            y: 10,
                                                  style: {
                                                       fontSize: '13px',
                                                       fontFamily: 'Verdana, sans-serif',
                                                       textShadow: '0 0 3px black',

                                                        }
                                                  }
                                              }]
	        });
	    });
      

Run codeHide result


1.php only has a MySQL re-query $ sth = mysql_query ("SELECT DateandTime, BP FROM table WHERE ID = '". $ Id. "'");

+3


source to share


1 answer


You should be able to accomplish what I believe you indicate what you want, do a few of the things listed below.

First, you will need to rebuild your JSON package to include the labels that Highcharts can use in the series, like this:

var json = {
    data: [ ["100/50",(100/50)], ["100/60",(100/60)], ["100/75",(100/75)], ["100/30",(100/30)] ]
};

      

Then you will need to make a few changes to the js diagram so that you override the default tooltip by adding this block to the highcharts config object (right after the xAxis block is a good place for it):



xAxis: {
    //some xAxis overrides here
},
tooltip: {
    pointFormat: ''
},

      

What this does is basically talking about high rates to make the tooltip point '', so essentially it doesn't show up, but the shortcut still shows up on your cursors.

This is done, your yAxis labels will still be decimal values ​​representing the steps of the fraction range, so you will either want to suppress this or handle it otherwise.

+1


source