Pre loader

Set chart paddings

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

chart screenshot

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

Version
2.5.0
Images
  • You must to post comments
1
0

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

  • You must to post comments
0
0

Hi Laszio,

Have you tried to use GrowBy property?

final IAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();

Best regards,
Yura

  • You must to post comments
0
0

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

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies