
1:
XAxis xAxis = mChart.getXAxis();
xAxis.enableGridDashedLine(10f, 10f, 0f);
// xAxis.setTypeface(tf);
xAxis.setTextSize(12f);
xAxis.setTextColor(Color.BLACK);
xAxis.setDrawGridLines(true);
xAxis.setDrawAxisLine(true);
xAxis.setSpaceBetweenLabels(1);
xAxis.setPosition(XAxisPosition.BOTTOM);
my case like "A" at picture, how can i set it like "B" at picture? (all line of grid background are dashed line)
i use this code, but it can't show me the dashed line of vertical direction, why?
rightAxis.enableGridDashedLine(...)
leftAxis.enableGridDashedLine(...)
xAxis.enableGridDashedLine(...)
rightAxis.enableGridDashedLine(...)
leftAxis.enableGridDashedLine(...)
xAxis.enableGridDashedLine(...)
i had use this code, but it can't show me the dashed line of vertical direction, is there something forget to add?
@wonghoman try to enable/disable hardware acceleration. I'm sure this is a bug because if
x-axis can be dashed without any tweaking then y-axis MUST has the same behaviour.
mChart.setHardwareAccelerationEnabled();
@PhilJay your _"works for me & close issue & don't care"_ strategy is wrong.
Thanks for letting me know what I do wrong. Some people really seem to be stupid enough to think that I don't have anything better to do than answering questions all day long that have been asked multiple times all over again for free. So yes, sometimes my answers are short, and issues are closed quickly. In the meantime, there is no appreciation that this an open source project free for everybody to use. Btw, this has already been fixed #755
Great.
Nobody makes you deal with it.
Better to change project's description to "WRITE SHIT CODE & DONT CARE & WANNA DONATION".
For god sakes. @mirage89. This is an OPEN SOURCE project. Phil is not working for you. The fact that even one line of code from this project is free and available to you, is a gift that you should really not take for granted.
When I saw this response, I really did not want to lower myself to this level and actually dignify this with a response. But this is for everyone who might ever read this:
Hi, first of all, thank you for a great library!:)
I just have one problem, almost the same as "wonghoman". I want the vertical gridlines to be dashed. At the moment the vertical lines are not dashed, they are just "regular" lines.
This is what I've tried:
XAxis xAxis = mBarChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawAxisLine(false);
xAxis.setDrawGridLines(true);
xAxis.enableGridDashedLine(10f, 10f, 2f);
....
YAxis leftAxis = mBarChart.getAxisLeft();
leftAxis.setDrawAxisLine(false);
leftAxis.setDrawGridLines(true);
leftAxis.enableGridDashedLine(10f, 10f, 0f);
leftAxis.setEnabled(false);
YAxis rightAxis = mBarChart.getAxisRight();
rightAxis.setDrawGridLines(true);
rightAxis.setDrawAxisLine(false);
rightAxis.enableGridDashedLine(10f, 10f, 0f);
rightAxis.setEnabled(false);
What am I missing?
Thank you in advance!
@alexandrastockman88 you need enable it for LineDataSet:
// create a dataset and give it a type
LineDataSet set2 = new LineDataSet(values, "");
set2.enableDashedLine(8, 8, 0);
@alexandrastockman88 @wonghoman: late reply so I don't know if you have addressed your issue. I bumped into the same issue and I just requested a Pull Request that should resolve it. If you were both using a BarChart or a HorizontalBarChart then it could not work as the code adding the dash effect had not been propagated to their corresponding renderers ;)
Most helpful comment
For god sakes. @mirage89. This is an OPEN SOURCE project. Phil is not working for you. The fact that even one line of code from this project is free and available to you, is a gift that you should really not take for granted.
When I saw this response, I really did not want to lower myself to this level and actually dignify this with a response. But this is for everyone who might ever read this: