Hello. I originally added my scrollbars to my chart during the initialization of my chart. I'm doing all I can to improve startup time, so I modified my project to only create and add my scrollbar until the user needs them (they zoom in).
They changed appearance from this
to this:
How do I get them back to their original style? I'm not sure why the style changed?
Scrollbars - changing style when added later
Moderator: Queue Moderators
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Scrollbars - changing style when added later
Maybe ColorTheme property setting overrides the color settings?
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: Scrollbars - changing style when added later
That's definately the cause.
The old way (with loading scrollbars immediately)
1) program starts
2) add scrollbars
3) apply theme
the new way (lazy loading the scrollbars)
1) program starts
2) apply theme
(some time passes)
3) add scrollbars
I don't want to have to re-apply the theme to the entire chart, but is that my only option? I don't know how to apply theme to just the scrollbars.
The old way (with loading scrollbars immediately)
1) program starts
2) add scrollbars
3) apply theme
the new way (lazy loading the scrollbars)
1) program starts
2) apply theme
(some time passes)
3) add scrollbars
I don't want to have to re-apply the theme to the entire chart, but is that my only option? I don't know how to apply theme to just the scrollbars.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Scrollbars - changing style when added later
Applying ColorTheme sets the colors of objects that currently exist in the chart. For objects to be created in the future, it has no effect.
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: Scrollbars - changing style when added later
I dug into the source code, and I pulled the 'set scrollbar colors' part of 'set theme' to its own public method (which set theme now calls), and was able to get it working. Was hoping I wouldn't have to change the code, but it seems the only way to get screen items to be the correct color when added at runtime.
Easy fix though
Also, if source code stuff is something I shouldn't be discussing on the forum, let me know and I'll take it down.
Easy fix though
Also, if source code stuff is something I shouldn't be discussing on the forum, let me know and I'll take it down.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Scrollbars - changing style when added later
Great you got it solved Excellent work.
Discussing source code is perfectly OK in this level. Showing actual LC source code here would be too revealing though.
Discussing source code is perfectly OK in this level. Showing actual LC source code here would be too revealing though.
LightningChart Support Team, PT