i need a graph something like this can anyone help me by providing working example on fiddle ?
my current code is:
initCharts: function() {
if (Morris.EventEmitter) {
// Use Morris.Area instead of Morris.Line
dashboardMainChart = Morris.Area({
element: 'sales_statistics',
padding: 15,
// behaveLikeLine: false,
gridEnabled: true,
// gridLineColor: false,
axes: true,
fillOpacity: 0.3,
data: [{
period: '2011 Q1',
profit: 0
}, {
period: '2011 Q2',
profit: 20
}, {
period: '2011 Q3',
profit: 50
}, {
period: '2011 Q4',
profit: 40
}, {
period: '2011 Q4',
profit: 60
}],
lineColors: ['#91C120'],
xkey: 'period',
ykeys: ['profit'],
labels: ['Profit'],
xLabels:['week'],
pointSize: 5,
pointFillColors: ['#FFF'],
lineWidth: 3,
hideHover: 'auto',
resize: true
});
}
}
the first problem is i want to use graph target element by class not id because i want to use it multiple times on a single page
second i cant find a way to place days like the image above on xLabels
third i want grids similar with the image
element:$('.yourClass'),
xLabelFormat
option, like this: xLabelFormat:function(x){day=x.getDay(); days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; return days[day];}
circle{ stroke-width:4 } tspan[dy]{ stroke:#91C120 }
A full demo can be viewed here: http://jsbin.com/nunusopaca/1/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.