Pre loader

Tag: IThemeProvider

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

1 vote
2k views

This demo was very helpful in working export out. I have a followup question. For a specific user request, I’m currently attempting something along these lines (current state; there’s some spaghetti-against-the-wall method going on at the moment):

const previousTheme = surface.themeProvider;

    const exportTheme = {
        ...previousTheme,
        sciChartBackground:"Transparent",
        gridBackgroundBrush:"Transparent",
        axisBandsFill: "Transparent"
    }

    surface.applyTheme(exportTheme);
    surface.background = "Transparent";

    new Promise(r => setTimeout(r, 1000)).then(() => {
        try {
            const node = document.getElementById('scichart-stuff');
            if (!node)
                return;
            domtoimage
                .toPng(node )
                .then(function (blob) {
                    saveAs(blob, 'plot.png');
                })
                .catch(function (error) {
                    console.error('Problem exporting/saving image of plot', error);
                });
        } finally {
            surface.applyTheme(previousTheme);
        }
    })

I am able to see the update (after adding the delay) on the screen, but the export appears to be ignoring the values I’m setting. I’m wondering what I might be missing in terms of the interactions of these libraries.

0 votes
9k views

Hello!

I am building an iOS framework that sits on top of SciChart for app developers within our company. I’d like to provide my own default SCIThemeColorProvider object for charts in my framework. Easiest way to do that is to include my own theme plist in my framework’s bundle, but I cannot currently do that (as of 2.0.0.1643) because the SCIThemeColorProvider initializer assumes it’s either in the “Charting.SciChart” bundle or the main bundle.

I’d like to propose modifying SCIThemeColorProvider to add another initializer that takes a bundle ID, like this:

/**
 * Creates theme provider based on specified style
 *
 * @param themeKey The key of style which should be used as base for this theme provider
 *
 * @param bundleIdentifier The identifier of the bundle containing the theme plist identified by 
 *                         themeKey; if nil, the main bundle is used.
 */
- (nullable instancetype)initWithThemeKey:(nonnull NSString*)themeKey bundleIdentifier:(nullable NSString*)bundleIdentifier;

The existing -initWithThemeKey: initializer would call through to this initializer with a nil bundle ID.

I have attached a patch file with this proposed change. Could this be added to an upcoming build?

0 votes
9k views

Hello everybody,
I am trying to generate a general theme for all charts in all my applications. I first tried using the ResourceDictionary implementation as described in https://www.scichart.com/documentation/v4.x/webframe.html#Creating%20a%20Custom%20Theme.html unfortunatelly this solution does not seem to provide functionalities for changing the default Brush of VerticalLineAnnotations, which is important for my application. So I tried implementing my custom theme using a ThemeColorProvider object, but I can’t find a way to add it to the ThemeManager.

Setting setting the style of each plot manually using IThemeProvider.ApplyTheme(…) is not an option since the theme style of all charts needs to remain configurable via ThemeManager.

Can somebody give me an advice, on how to implement styling of VerticalLineAnnotations in XAML ResourceDictionary or how to add an ThemeColorProvider object to the ThemeManager.

Thanks a lot and regards,
Dirk

1 vote
14k views

I like the BlackSteel theme for the data chart, but like to modify a little bit of it. Is there a way for me to use the blackSteel theme that come out of the box as a start, and customize it a little to meet our customer’s needs?

Thanks,

  • JaneZ asked 11 years ago
  • last active 9 years ago
1 vote
20k views

Please help to provide a tutorial example to implement IThemeProvider interface in order to make a custom theme.

Thanks,
Tanmay

Showing 5 results

Try SciChart Today

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

Start TrialCase Studies