I need to draw a chart based on some values given.
This is how my data looks like…
(Date on xAxis and Values on yAxis)
|| Date || X1 || X2 || X3 ||
|| 01-01-2008 || 1 || 2 || 3 ||
|| 01-01-2008 || 2 || 3 || 4 ||
|| 01-02-2008 || 1 || 2 || 3 ||
|| 01-03-2008 || 1 || 2 || 3 ||
|| 01-04-2008 || 1 || 2 || 3 ||
So now in the graph i need to get a straight vertical line for first two values plotted.
But the line chart from visualization api is showing two separate columns for first two date values…
i.e.,
xAxis - Jan 01, 2008 || Jan 01, 2008 || Feb 01, 2008 || Mar 01, 2008 || Apr01, 2008
instead of
xAxis - Jan 01, 2008 || Feb 01, 2008 || Mar 01, 2008 || Apr01, 2008
and plotting a vertical straight line for Jan 01, 2008
the graph should have vertical straight line for Jan 01, 2008 without omitting the duplicate values...
so that the two values that are against Jan 01, 2008 are displayed vertically
Please help me solve this.
Use the Set collections for storing the values, A set is a collection that contains no duplicate elements. So once you store “Jan 01,2008”, it will not allow duplicates.
use any implementation class of Set,
here im assuming you are storing String values, but you can change it according to your need.