-
Notifications
You must be signed in to change notification settings - Fork 95
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
What is the professional way to invert xAxis values from max to min? #261
Comments
Hi osaidmakhalfeh, this is a property of the axis. See invertAxis(boolean) |
Hi osaidmakhalfeh, we just found that issue as I wanted to point you to one of the samples. |
@osaidmakhalfeh can you give it a try with the fixed version in the 'fix261' branch? If you do not want to compile yourself, you can also use the snapshot repository as described here. Just enable the snapshot repository and use |
... a fix a day keeps harm a way. @osaidmakhalfeh thanks for asking a question and triggering us to fix that issue. This must-have slipped in during one of the last commits and we did not catch this earlier. Let us know if this fixes and helps with your particular application |
... now merged to master. Thanks to @milo-gsi for cross-checking. |
A lot of thanks Guys @RalphSteinhagen @milo-gsi . But there are new icons that appeared after the fix. I'm not sure what is that I'm trying to solve it! |
@osaidmakhalfeh this is unrelated and the normal expected behavior. The brackets '[]' contain the units ("" as a default in this case). In case you want to suppress this, you may want to set |
That works! I mean it is related to the unit value on the axis. My last question to you -> I tried to draw a bar from that points on the charts, but here I'm facing a new problem:
Regards |
@osaidmakhalfeh these are the markers... can be controlled via |
I tried what you said. But unfortunately, I'm getting the same result! maybe it is something else? ! |
@osaidmakhalfeh is your project publically available or would you perhaps have an MVP sample? |
To be honest with you, I'm on research about charts Thanks a lot @RalphSteinhagen |
@osaidmakhalfeh thanks for the link: 👍 You are using errorRenderer2.setErrorType(ErrorStyle.NONE); Also, you seem to use different DataSets to achieve different colours for a given range or particular values. This can be also achieved with one DataSet and the 'DataSet::addDataStyle(,"fillColor=<...color...>");` option. Have a look at the samples for more options how you can modify the look-and-feel of the DataSets... E.g. taken from your code-snippet: // [..]
xAxes.invertAxis(true);
final DoubleDataSet dataSet = new DoubleDataSet("dataSet");
dataSet.setStyle("-fx-stroke: rgb(0, 0, 0)");
for (int i = 0; i < 200; i++) {
dataSet.add(i, i * 2);
if (i < 10) {
dataSet.addDataStyle(i, "fillColor=red; markerColor=red");
} else if (i < 50) {
dataSet.addDataStyle(i, "fillColor=blue; markerColor=blue");
} else {
dataSet.addDataStyle(i, "fillColor=green; markerColor=green");
}
}
errorRenderer2.getDatasets().addAll(dataSet);
errorRenderer2.setPolyLineStyle(LineStyle.NONE);
errorRenderer2.setErrorType(ErrorStyle.NONE);
errorRenderer2.setDrawMarker(false);
errorRenderer2.setDrawBars(true);
errorRenderer2.setDynamicBarWidth(false);
errorRenderer2.setBarWidth(5);
errorRenderer2.setShowInLegend(false);
errorRenderer2.setPointReduction(false);
// [..] In case you need three DataSets, then it might be better that each DataSet has a data point definition for each x-value (and the Some random comments:
Let us know if this helps your cause... |
Sure, it works. I do not know what to say, |
@osaidmakhalfeh hope this is not the last we are going to read from you. Hope the above has been useful and enjoyable! Feel free to contact us if you have questions, bugs or just want to contribute to chart-fx (features, tutorials, examples, docs ...) |
@RalphSteinhagen sure, I think I can prepare now a good docs & tutorials for others, and I will send something to you very soon. |
Hi Dears,
First of all I want to thank you again for this amazing work!
Here, I'm trying to draw the xAxis from the "Max" to the "Min" values.
I'm not sure, how can I do it easily?
Thanks a lot
The text was updated successfully, but these errors were encountered: