MPAndroidChart
MPAndroidChart copied to clipboard
Implement tick marks on axis
Hi,
is it possible to add tick marks on axis in correspondence of the labels? Something like this:
Maybe they can be simply an extension of the grid lines.
I have a similar problem, a graph with a lot of values so I have to show only some labels on the x axis. Without tick marks it's very difficult to understand which value match the label. Thanks
Facing same Issue. Any answer ?
I'm just learning, but I seem to have managed to add tick marks to the line chart. Here is a link to the cloned library https://github.com/spirit0fcom/MPAndroidChart/tree/57aaf9a415b6068a07e920ce9ea0d94a1b7516be
You should add something like this:
xAxis = chart.getXAxis();
xAxis.setDrawTickMarks(true);
yAxis = chart.getAxisLeft();
yAxis.setDrawTickMarks(true);
Maybe it can be usefull)

Is this possible for bar charts?
Okay, I've been working on an implementation for tick marks for the x-axis that involves extending the XAxisRenderer class. In particular, I created a new function that just draws a dashed line (using DashPathEffect). I'll try to release some code after I clean it up and if people are interested.
Okay, I've been working on an implementation for tick marks for the x-axis that involves extending the
XAxisRendererclass. In particular, I created a new function that just draws a dashed line (usingDashPathEffect). I'll try to release some code after I clean it up and if people are interested.
I would be very interested in seeing how you managed to do that, do you think you could release some code? I'm currently trying to add tick marks to a line graph but the methods used in this post do not work.
I would be very interested in seeing how you managed to do that, do you think you could release some code? I'm currently trying to add tick marks to a line graph but the methods used in this post do not work.
Yah, of course! You can find the code here.
Unfortunately, this was sort of an experiment of rewriting an app, which I ended up abandoning because of other priorities. So, I haven't looked at the code in a bit. I'll try to find some time to clean up the code again.
Please let me know if you have any suggestions, or think of a better way of creating the ticks!
EDIT: the code also includes an "accent tick" line (currently for every 3rd tick or something), which doesn't really align perfectly
I'm just learning, but I seem to have managed to add tick marks to the line chart. Here is a link to the cloned library https://github.com/spirit0fcom/MPAndroidChart/tree/57aaf9a415b6068a07e920ce9ea0d94a1b7516be
I suppose it's not gonna be up to date with the original library
Would be great to have tick marks.
same issue
works with LabelRotationAngle
@Silvia4 Did you find any solution for this
Hi, is it possible to add tick marks on axis in correspondence of the labels? Something like this:
Maybe they can be simply an extension of the grid lines.
I have a similar problem, a graph with a lot of values so I have to show only some labels on the x axis. Without tick marks it's very difficult to understand which value match the label. Thanks