Rank: Advanced Member
Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered Joined: 1/3/2011(UTC) Posts: 483
Thanks: 0 times Was thanked: 87 time(s) in 87 post(s)
|
Hi, You can "axisLabelCreating" event to customize your y-axis labels: http://www.jqchart.com/jquery/chart/CustomizingChart/AxisLabelCreatingEventHere is a sample code: Code:$(document).ready(function () {
$('#jqChart').bind('axisLabelCreating', function (event, data) { if (data.context.axis.location == 'left') {
switch (data.text) { case '1': data.text = 'A'; break; case '2': data.text = 'B'; break; case '3': data.text = 'C'; break; default: data.text = ''; break; } } });
$('#jqChart').jqChart({ title: { text: 'Line Chart' }, tooltips: { type: 'shared' }, animation: { duration: 1 }, axes: [ { location: 'left', minimum: 0, maximum: 4, interval: 1 } ], series: [ { type: 'spline', data: [[new Date(2010, 0, 1), 1], [new Date(2010, 0, 2), 2], [new Date(2010, 0, 3), 3], [new Date(2010, 0, 4), 2]] } ] }); }); Best Regards, Dragan Matek jqChart Inc.
|