简体   繁体   English

Spotfire中的Ironpython-绘制曲线并修改图表

[英]Ironpython in Spotfire - draw curve and modify chart

I have a code that changes my visualisation type from a Line to a Bar chart based on a property type . 我有一个代码,可根据属性类型将可视化类型从折线图更改为条形图。 I need add a query to draw a straight line based on a property within my visualisation. 我需要添加一个查询以根据可视化中的属性绘制一条直线。 The code I have so far is this: 到目前为止,我的代码是:

from Spotfire.Dxp.Application.Visuals import VisualContent
from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers 

vc1 = viz1.As[VisualContent]()

Yaxis=vc1.YAxis.Expression
Xaxis=vc1.XAxis.Expression
ColorAxis=vc1.ColorAxis.Expression 

if type=="LINE":
viz1.TypeId = VisualTypeIdentifiers.LineChart
if type == "BAR":
viz1.TypeId = VisualTypeIdentifiers.BarChart

vc1.XAxis.Expression=Xaxis
vc1.YAxis.Expression=Yaxis
vc1.ColorAxis.Expression=ColorAxis

Thanks in advance for your help! 在此先感谢您的帮助!

from Spotfire.Dxp.Application.Visuals import LineChart
if vis.As[LineChart]().FittingModels[0].Enabled == False:
 vis.As[LineChart]().FittingModels[0].Enabled = True
else:
 vis.As[LineChart]().FittingModels[0].Enabled = False

This code requires a vis parameter defined as Type: Visualization Value: Page > Line Chart 此代码需要一个vis参数,定义为Type:可视化值:Page> Line Chart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM