I want to create a chart that has 3 curves set up like this:
X Axis: Hour of Day
Left Y Axis : Temperature
Right Y Axis : Dollars (single axis shared for Joe and Jane values)
Temperature would be a bar chart and Dollars would be a line chart.
My data would look like this:
I see the example at :
http://www.smartclient.com/smartgwtee/showcase/#multiSeriesChartMA
But I'm not quite sure how to leverage that example for my needs.
I think I need facets called Dollars, Hour, and Temperature in order to set up the axis. But it also seems like every record needs to have values in every field. For example when I tried to set up date that looked like this:
ID for Temp Curve = 1.
ID for Joe = 2;
ID for Jane = 3;
ID=1, Hour=1, Temperature=60
ID=2, Hour=1, Dollars=2.1
ID=3, Hour=1, Dollars=1.2
ID=1, Hour=2, Temperature=80
ID=2, Hour=2, Dollars=3.1
ID=3, Hour=2, Dollars=2.3
etc.
It did not seem to work. Am I on the right track? If yes then I can set up a more complete example. If not can you please point me in the right direction?
Here are the test changes I made to the demo:
When I make the changes above - North America only has Percent Values, Europe and Asia-Pacific only have Event values, the event values plot but the percent ones do not. I also get 6 legend items even though there should really only be 3 since there are only 3 distinct curves.
Any direction you can provide is greatly appreciated.
X Axis: Hour of Day
Left Y Axis : Temperature
Right Y Axis : Dollars (single axis shared for Joe and Jane values)
Temperature would be a bar chart and Dollars would be a line chart.
My data would look like this:
Code:
Hour Temperature $Joe $Jane 1 60 2.1 1.2 2 80 3.1 2.3 3 100 2.2 3.4 4 120 4.0 6.2
I see the example at :
http://www.smartclient.com/smartgwtee/showcase/#multiSeriesChartMA
But I'm not quite sure how to leverage that example for my needs.
I think I need facets called Dollars, Hour, and Temperature in order to set up the axis. But it also seems like every record needs to have values in every field. For example when I tried to set up date that looked like this:
ID for Temp Curve = 1.
ID for Joe = 2;
ID for Jane = 3;
ID=1, Hour=1, Temperature=60
ID=2, Hour=1, Dollars=2.1
ID=3, Hour=1, Dollars=1.2
ID=1, Hour=2, Temperature=80
ID=2, Hour=2, Dollars=3.1
ID=3, Hour=2, Dollars=2.3
etc.
It did not seem to work. Am I on the right track? If yes then I can set up a more complete example. If not can you please point me in the right direction?
Here are the test changes I made to the demo:
Code:
public MultiAxisChartData(String area, String date, float percent) { setAttribute("area", area); setAttribute("date", date); setAttribute("percent", percent); } public MultiAxisChartData(String area, String date, int events) { setAttribute("area", area); setAttribute("date", date); setAttribute("events", events); } ..... public static MultiAxisChartData[] getData() { return new MultiAxisChartData[] { new MultiAxisChartData("1", "13 Sep 12", 0.55f), new MultiAxisChartData("2", "13 Sep 12", 3210), new MultiAxisChartData("3", "13 Sep 12", 2071), new MultiAxisChartData("1", "14 Sep 12", 0.49f), new MultiAxisChartData("2", "14 Sep 12", 3771), new MultiAxisChartData("3", "14 Sep 12", 2166), }; }
Any direction you can provide is greatly appreciated.
Comment