I want to make a Highchart (basic line chart) which can have multiple values vs x axis.
I am trying to make a line chart with value (y axis) vs date (x axis). The problem is there can be multiple values or a perticular date. I am new to Highcharts but I went through the API and did not find a way to plot such graph which has multiple value (on y axis) vs x axis plot. I want the date to be in "06july" format.
This is my code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#g1').highcharts({
chart:{
polar:true,
backgroundColor:'#E9BE51'
} ,title: {
text: 'Cholesterol',
x: -20 //center
},
xAxis: {
//categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug']
//type: 'date'
},
yAxis: {
title: {
text: 'Value(mmol/L)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: 'in'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [ {
name: 'Total',
data: [{ name:'jan' , y:12} , {name:'jan' , y:8.2}, {name:'mar' , y:10.2} , {name:'apr' , y:14.5}]
}/*, {
name: 'LDL',
data: [['jan',3.9],[ 'feb', 4.2],['mar', 5.7],['apr', 8.5] ]
}, {
name: 'HDL',
data: [['jan',4.9], [ 'feb',4.0], ['mar',4.5],['apr', 6]]
}*/]
});
});
</script>
</head>
<body>
<script src="../../js/highcharts.js"></script>
<div class="container" id="g1" style="width: 50%; height: 50%; margin: ; "></div>
</body>