So I am trying to set paddings on the chart, so that the data series do not touch chart edges
I can’t do it with View’s method setPadding because then the black background is present (screenshot shows padding on all sides but I need just left and right)
Also, I managed to achieve no labels, axes, grids etc. but in totally hacky way; I set .withIsCenterAxis and then all other things to false
.withAxisId(Y_AXIS_ID)
.withDrawMajorBands(false)
.withDrawMajorGridLines(false)
.withDrawMinorGridLines(false)
.withDrawLabels(false)
.withIsCenterAxis(true)
.withDrawMajorTicks(false)
.withDrawMinorTicks(false)
Is there a normal way of doing this?
thanks
- Laszlo Bonkers asked 5 years ago
- You must login to post comments
Hi Laszlo,
You can change chart’s background by creating custom theme ( https://www.scichart.com/example/android-chart-example-create-a-custom-theme/ ). Also you can extend one of existing theme and only override desired values:
<style name="SciChart_BerryBlue" parent="SciChart_SciChartv4DarkStyle">
<item name="sciChartBackground">@drawable/example_sci_chart_berry_blue_background</item>
</style>
Regarding hiding axis labels – this is one of correct ways to do this. Another way is to set visibility of axis to GONE to hide it.
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Hi Laszio,
Have you tried to use GrowBy property?
final IAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Yes, it doesn’t do the job. My chart has to have exactly 16dp left and right paddings, grow doesn’t allow that, also when zooming the ‘paddings’ are gone when using growBy.
Is there a possibilty to change the black background somehow?
And please if you can answer my second question
- Laszlo Bonkers answered 5 years ago
- You must login to post comments
Please login first to submit.