Hello! I'm starting out with this API and looks goooooood.
I can't align the data values to the month bottom axis. Is there a
paramenter that I'm missing...
Here is my code:
// Specify chart width and height in pixels
LineChart chart = new LineChart(600, 120);
ChartAxis bottomAxis = new ChartAxis(ChartAxisType.Bottom);
bottomAxis.AddLabel(new ChartAxisLabel("Jan", 10));
bottomAxis.AddLabel(new ChartAxisLabel("Feb", 20));
bottomAxis.AddLabel(new ChartAxisLabel("Mar", 30));
bottomAxis.AddLabel(new ChartAxisLabel("Apr", 40));
bottomAxis.AddLabel(new ChartAxisLabel("May", 50));
bottomAxis.AddLabel(new ChartAxisLabel("Jun", 60));
bottomAxis.AddLabel(new ChartAxisLabel("Jul", 70));
bottomAxis.AddLabel(new ChartAxisLabel("Aug", 80));
bottomAxis.AddLabel(new ChartAxisLabel("Sep", 90));
bottomAxis.AddLabel(new ChartAxisLabel("Oct", 100));
bottomAxis.AddLabel(new ChartAxisLabel("Nov", 110));
bottomAxis.AddLabel(new ChartAxisLabel("Dec", 120));
bottomAxis.FontSize = 14;
chart.AddAxis(bottomAxis);
ChartAxis leftAxis = new ChartAxis(ChartAxisType.Left);
leftAxis.SetRange(0, 12);
leftAxis.AddLabel(new ChartAxisLabel("0", 0));
leftAxis.AddLabel(new ChartAxisLabel("2", 2));
leftAxis.AddLabel(new ChartAxisLabel("4", 4));
leftAxis.AddLabel(new ChartAxisLabel("6", 6));
leftAxis.AddLabel(new ChartAxisLabel("8", 8));
leftAxis.AddLabel(new ChartAxisLabel("10", 10));
leftAxis.AddLabel(new ChartAxisLabel("12", 12));
chart.AddAxis(leftAxis);
// I added the -1 so it starts on january
int[] theData = { -1, 2, 2, 4, 0, 9, 1 ,4, 2, 9, 0, 0, 0 };
// SetData will accept int[] and float[] for single data sets
chart.SetData(theData);
Thanks!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-chart-api?hl=en
-~----------~----~----~----~------~----~------~--~---