0

Say I've created a theme like this. I've named it ChartTheme_Normal. I apply it to a ThemeManager object like this:

ThemeManager themeManager = new ThemeManager();
themeManager.addTheme(this, R.style.ChartTheme_Normal);

At that point, how do I go from there to adding it to the SciChartSurface I have?

SciChartSurface has a applyThemeProvider(IThemeProvider) method, but it requires an IThemeProvider and it looked like you could avoid using that if you made the theme in styles.xml and used ThemeManager.

If my understanding of themes in SciChart is completely off, please correct it if you're able to. I'm not familiar with this.

TheKingElessar
  • 1,654
  • 1
  • 10
  • 30

1 Answers1

1

You don't need to add theme into ThemeManager. You just need to declare new theme in styles.xml and apply it to SciChartSurface instance by calling setTheme():

// set theme id from styles
surface.setTheme(R.style.SciChart_BerryBlue);

That's all you need to do to apply new theme in SciChart Android

Yura Khariton
  • 484
  • 2
  • 6
  • I did see the `setTheme` method for `SciChartSurface` but when I tried using it my IDE (Android Studio) wasn't recognizing it as a valid method. Do I need to update the version I'm using? – TheKingElessar Apr 05 '19 at 19:25
  • Oh, wait! I was using `ISciChartSurface`. I switched it over to `SciChartSurface` and it's all good. I'll try it out. If you're able to can you explain the difference between the classes with the I prefix and those without? – TheKingElessar Apr 05 '19 at 19:29
  • 1
    The difference is that [ISciChartSurface](https://www.scichart.com/documentation/android/v2.x/webframe.html#SciChart.Charting~com.scichart.charting.visuals.ISciChartSurface.html) is just an interface which defines some chart methods and it is implemented by [SciChartSurface](https://www.scichart.com/documentation/android/v2.x/webframe.html#SciChart.Charting~com.scichart.charting.visuals.SciChartSurface.html) class which represents actual chart. – Yura Khariton Apr 08 '19 at 06:26
  • Ah, that makes complete sense. So, you'd use the interface to make your own SciChartSurface-type class. – TheKingElessar Apr 08 '19 at 14:43