Change Heatmap through Ironpython API

Hi, I hopethere is someone out there that can help me with the following:

I have a two buttons on my Visulisation to change between a heatmap and a tree map, giving the user the ability to look at the data in two ways.

code:

from Spotfire.Dxp.Application.Visuals import VisualContent
from Spotfire.Dxp.Application.Visuals import HeatMap
from Spotfire.Dxp.Application.Visuals import ColorScheme
from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers
from Spotfire.Dxp.Data import DataTable
from Spotfire.Dxp.Application.Visuals import MapChart
from Spotfire.Dxp.Application.Visuals import Legend
from System.Drawing import ColorTranslator

viz.TypeId = VisualTypeIdentifiers.HeatMapvc = viz.As[HeatMap]()
vc.YAxis.Expression = '<[Channel] NEST [Customer]>'
vc.XAxis.Expression = '<if([Company]="BML",[Brand],null) as [BML]>'
vc.MeasureAxis.Expression = 'Sum(${ForecastMonth} - ${ForecastCompare}) as [GP Diff]'
vc.Title = 'World View'

vc.ShowDescription = True

vc.Legend.Visible = True

But when it swithce it resets the colour scheme. How do i set a colour scheme that i have saved to the dashboard? I have trawled through the Tech ref but cant find the stpes needed. also i have the heatmap xaxis nested, but when i swith between the visulisations with the buttons it restes the width that was set for the xaxis. can i stop this by a setting?

Any help would be great.

(1) Answer

Login