Jump to content

 

ThomasRK

Member Since 20 Jul 2009
Offline Last Active Apr 06 2010 11:03 AM
-----

Topics I've Started

Interval problem

05 November 2009 - 02:45 PM

Hi!

We have created a Designer tool to let users create their own Visifire reports. One of our users complained about our tool hanging whenever he entered a value for the Interval on the X- or Y-axis. The problem was related to his data in the graph. The Y-axis had data up to 500.000, and when Visifire was trying to make intervals on 5, the application just hangs in the redraw of the graph.

This is of course a “user error”, but it would be nice to have some kind of control within Visifire as well? I guess hundreds of intervals in a report is never a good solution…

Thanks,
Thomas

Loading XML defintion to WPF

20 July 2009 - 07:06 PM

Hi!

We have an application designed to show reports, where one part of the app is for designing charts using Visifire. I want to give the user a real time feedback on changes, by providing a WYSIWYG chart preview. We have a report object we use in the web client consuming the reports. This object returns a xml definition of the Visifire chart. This works fine when we use the setDataXml() function in the web site.

The problem occurs when trying to use the same XML in WPF to give the WYSIWYG to the user. By reading this forum it seems that the best solution should be something like this:

string t = Report.ChartDefinition;
StringReader stringReader = new StringReader(t);
System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(stringReader);
Chart chart = (Chart)System.Windows.Markup.XamlReader.Load(xmlReader);
            
The Report.ChartDefinition property will give an xml as the attached in the bottom of the posting.

The XamlReader function does not work with our xml definition. It gives an error message from the XamlReader.Load function:

“Cannot add content to an object of type Chart…”.

The very same xml definition works fine when using the setDataXml() function in our website.

Is it possible to use our xml defintion from the setDataXml() different from the XamlReader.Load() definition?

Any suggestion on how to solve this problem?

Any other ways of loading our report definition to a wpf chart?

Thanks,
Thomas


<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=Visifire.Charts" Watermark="False"  Theme="Theme1"  ColorSet="DullShades"  BorderThickness="0"  AnimationEnabled="True"  Bevel="False"  LightingEnabled="True"  ShadowEnabled="False"  UniqueColors="False"  View3D="True" >
<vc:Title  Enabled="True"  Text="This is a report"  FontFamily="Verdana"  FontSize="16"  FontStyle="Normal"  FontWeight="Normal"  Href="http://www.vg.no"  V...olTipText="This is a tooltip"  DockInsidePlotArea="False"  />
<vc:AxisX  Enabled="True"  TitleFontColor="#FFC14FCB"  TitleFontFamily="Verdana"  TitleFontSize="14"  StartFromZero="False"  ><vc:AxisLabels  Enabled="True"  FontColor="#FF31DDC6"  FontSize="12"  FontStyle="Italic"  FontWeight="Bold"  FontFamily="Comic Sans MS"  /></vc:AxisX>
<vc:AxisY AxisType="Primary"  Enabled="True"  TitleFontColor="#FFBF0B0B"  TitleFontFamily="Verdana"  TitleFontSize="14"  StartFromZero="False"  ><vc:AxisLabels  Enabled="True"  FontColor="#FF31DDC6"  FontSize="12"  FontStyle="Italic"  FontWeight="Bold"  FontFamily="Comic Sans MS"  /></vc:AxisY>
<vc:DataPoint  MarkerSize="15"  />
<vc:Legend  Enabled="True"  Background="#FFEB0E0E"  FontColor="#898989"  FontSize="12"  Title="Legend"  DockInsidePlotArea="False"  LightingEnabled="False"  ShadowEnabled="False"  Bevel="False"  />
<vc:MajorGrids  Enabled="True"  LineColor="#FFC81010"  LineStyle="Solid"  LineThickness="3"  />
<vc:MajorTicks  Enabled="True"  />
<vc:PlotArea  Background="#FFE5DDDD"  LightingEnabled="False"  ShadowEnabled="True"  Bevel="False"  />
<vc:ToolTip  FontColor="#292929"  FontFamily="Verdana"  FontSize="12"  />
<vc:TrendLine  Enabled="True"  LineColor="#FF77CF24"  LineThickness="5"  Opacity="0.5"  ShadowEnabled="False"  />
<vc:DataSeries  RenderAs="Column"  AxisYType="Primary"  Enabled="True"  ColorSet="SandyShades"  LineThickness="5"  BorderColor="#38455e"  BorderThickness="1"  LabelEnabled="False"  LabelLineEnabled="False"  MarkerEnabled="False"  MarkerSize="15"  LightingEnabled="False"  ShadowEnabled="False"  ShowInLegend="False"  Bevel="False"  Name="Salg" >
<vc:DataPoint AxisLabel="(3) MegaStore" YValue="0"/>
<vc:DataPoint AxisLabel="(4) SuperStore" YValue="565299799.9"/>
<vc:DataPoint AxisLabel="(6) EasyStore" YValue="9052473.54"/>
<vc:DataPoint AxisLabel="(7) AnytimeStore" YValue="89294155.94"/>
</vc:DataSeries>
<vc:DataSeries  RenderAs="Line"  AxisYType="Primary"  Enabled="True"  LineThickness="5"  BorderColor="#38455e"  BorderThickness="1"  Color="#FF34A52E"  LabelEnabled="False"  LabelLineEnabled="False"  MarkerEnabled="False"  MarkerSize="15"  LightingEnabled="False"  ShadowEnabled="False"  ShowInLegend="False"  Bevel="False"  Name="BruttoFortjeneste" >
<vc:DataPoint AxisLabel="(3) MegaStore" YValue="0"/>
<vc:DataPoint AxisLabel="(4) SuperStore" YValue="52583004.98"/>
<vc:DataPoint AxisLabel="(6) EasyStore" YValue="201582.27"/>
<vc:DataPoint AxisLabel="(7) AnytimeStore" YValue="21254518.08"/>
</vc:DataSeries>
</vc:Chart>