New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scatter Dataset ShowLine forced False #36
Comments
@lightingft I checked the post and the sample written teher is already available by Charba. LineDataset dataset1 = chart.newDataset();
dataset1.setLabel("dataset 1");
IsColor color1 = Colors.ALL[0];
dataset1.setBackgroundColor(color1.toHex());
dataset1.setBorderColor(color1.toHex());
dataset1.setFill(false);
double[] values = getRandomDigits(months);
DataPoint[] dp = new DataPoint[months];
for (int i=0; i<months; i++) {
dp[i] = new DataPoint();
dp[i].setX(i);
dp[i].setY(values[i]);
}
dataset1.setDataPoints(dp); Here the result: About the What do you think? |
@stockiNail Thanks for the response. I indeed followed a similar method that you showed for creating a Line Chart, and it worked nicely. However, it still seemed rather odd to me that no matter what value is passed into the Scatter Data Set show line method, the value is forced to false, causing confusion at first as to why the method does not work when first using it. Also, I think there are certain types of graphs that can be made with the Scatter Chart, but not with the Line Chart, where the point connection does not exactly follow the typical continuous Line Chart format. Here is an example posted in a Stack Overflow question. |
@lightingft yeah! I'll remove the overrided method in order that you can set the value that you want. By default, it will be set to |
Excellent! That is a nice change indeed. |
Commited into |
In Chart.js, sometimes it is more convenient to simply pass x & y values (instead of configuring string-based labels), and enable the show lines option to use a Scatter Chart as a Line Chart. In fact, this approach has been typically recommended in Stack Overflow posts, such as this one.
However, Charba forces ShowLine to be false for ScatterDataSet.
Was this intended, or was this simply a temporary placeholder?
The text was updated successfully, but these errors were encountered: