Products | Versions |
---|---|
Spotfire Analyst | 7.5 and Higher |
You can use the Document.GetStyle() method to get the style properties of elements in the user interface. There are various related classes such as StyleProperties, ColorInfo, FontStyle, FontWeight etc. See the attached image (Filename:Styling API.png) to get a brief idea about these classes.
var visualContentStyle = document.GetStyle(StyleElement.VisualContent); var backgroundColor = visualContentStyle.GetEffectiveBackgroundColor(); using (Brush backgroundBrush = new SolidBrush(backgroundColor)) using (Pen backgroundPen = new Pen(backgroundColor)) { renderArgs.Graphics.DrawRectangle(backgroundPen, renderArgs.Bounds); renderArgs.Graphics.FillRectangle(backgroundBrush, renderArgs.Bounds); }Refer to the RenderCore() in the TrafficLightchart.cs or CustomScatterPlot.cs of the CustomVisualsExample available with the SDK on how to manage the visualizations to blend in with the theme in the analysis.