javascript - HighCharts using Text in yAxis instead of numbers -
i have following jsfiddle of highchart working number values on yaxis want change it, data want put in instead of 26.5
26.5
16.5
26.5
hot
warm
cold
is there anyway working data received database formatted hot
warm
cold
$(function () { $('#container').highcharts({ chart: { type: 'spline' }, title: { text: 'monthly average temperature' }, subtitle: { text: 'source: worldclimate.com' }, xaxis: { categories: ['16 feb 15', '16 apr 15', '27 jul 15', '10 nov 15', ] }, yaxis: { title: { text: '' }, labels: { formatter: function () { return this.value + '°'; } } }, tooltip: { crosshairs: true, shared: true }, plotoptions: { spline: { marker: { radius: 4, linecolor: '#666666', linewidth: 1 } } }, series: [{ name: 'dates', data: [{ y: 26.5, marker: { symbol: 'url(http://www.highcharts.com/demo/gfx/sun.png)' } },{ y: 26.5, marker: { symbol: 'url(http://www.highcharts.com/demo/gfx/sun.png)' } },{ y: 16.5, marker: { symbol: 'url(http://www.highcharts.com/demo/gfx/sun.png)' } },{ y: 26.5, marker: { symbol: 'url(http://www.highcharts.com/demo/gfx/sun.png)' } } ] }] }); });
are saying want change label text, or want remove details actual data points , plot whether temperature 'cold', 'warm', or 'hot'?
if want data reflect 3 values, use categories on y axis, , you'll need use category index (0, 1, or 2) indicate category data point for
example
:
if want keep specific data values , change label, can use label formatter range of values return appropriate label, artm
showed.
Comments
Post a Comment