Jump to content

 

llarsson

Member Since 25 Mar 2010
Offline Last Active May 10 2010 03:34 PM
-----

Posts I've Made

In Topic: Static axis labels

07 April 2010 - 07:05 AM

Please show a code snippet of what you mean

Modifying the "Using XValue and AxisXLabel" With AxisXLabel + XValue while drawing as a Line one gets the numeric values inbetween, playing with the interval doesn't help either

                <vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="500" Height="300">
                    <vc:Chart.AxesX>
                        <vc:Axis Interval="10.0" />
                    </vc:Chart.AxesX>
                    <vc:Chart.Series>
                        <vc:DataSeries RenderAs="Line" LabelText="Test">
                            <vc:DataSeries.DataPoints>
                                <vc:DataPoint AxisXLabel="Jan" YValue="10" XValue="1" />
                                <vc:DataPoint AxisXLabel="Feb" YValue="20" XValue="5" />
                                <vc:DataPoint AxisXLabel="Mar" YValue="40" XValue="7" />
                                <vc:DataPoint AxisXLabel="Apr" YValue="50" XValue="12" />
                                <vc:DataPoint AxisXLabel="May" YValue="30" XValue="20" />
                            </vc:DataSeries.DataPoints>
                        </vc:DataSeries>
                    </vc:Chart.Series>
                </vc:Chart>

Edit: I wouldn't even want this serie to be visible

In Topic: Tabcontrol

06 April 2010 - 06:30 AM

I solved it, when I explored it a bit more and tried to make a good example to post I found that it was a timing error and hence got a strange problem with working sometimes (very seldom) so it could be solved by waiting for the right component to be loaded before updating the data. New to silverlight but one could possible argue that the component could have solved this for me.

In Topic: Render - update

25 March 2010 - 06:28 PM

updated, it was the layout that made it not update except as described in first post that one needs to iterate (foreach) instead of collection assignment which I will consider a bug (yes make it read-only or fix the setter for the attribute)

In Topic: Render - update

25 March 2010 - 02:25 PM

XAML

      
  <vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Name="chartDetails" 
                              Width="500" Height="300" BorderThickness="0" Theme="Theme1" 
                              View3D="False" ToolBarEnabled="True" Watermark="False" ScrollingEnabled="False" >
            <vc:Chart.AxesX>
                <vc:Axis Enabled="True">
                    <vc:Axis.Grids>
                        <vc:ChartGrid Enabled="True" />
                    </vc:Axis.Grids>
                </vc:Axis>
            </vc:Chart.AxesX>
            <vc:Chart.AxesY>
                <vc:Axis Enabled="True">
                    <vc:Axis.Grids>
                        <vc:ChartGrid Enabled="True" />
                    </vc:Axis.Grids>
                </vc:Axis>
             </vc:Chart.AxesY>
            <vc:Chart.Series>
                <vc:DataSeries Name="serie" RenderAs="Line" MarkerEnabled="True">
                </vc:DataSeries>
            </vc:Chart.Series>
        </vc:Chart>

C#

// First attempt
protected void UpdateDetailChart(DataPointCollection points) {
    serie.XValueType = ChartValueTypes.DateTime;
    serie.RenderAs = RenderAs.Line;
    serie.MarkerEnabled = true;

    foreach (DataPoint p in points)
    {
        serie.DataPoints.Add(p);
    }
}

// Another attempt
protected void UpdateDetailChart(DataPointCollection points) {
    DataSeries serie = new DataSeries();
    ... // same code as above
    chartDetails.Series.Clear();
    chartDetails.Series.Add(serie); 
}

Tried a lot of other stuff that didn't work either but this is what i really expected to work

In Topic: Render - update

25 March 2010 - 12:25 PM

Well the serie.DataPoints is of type DataPointCollection which extends ObservableCollection<DataPoint> and that would give compile error

But more importantly, why doesn't it update (re-render) sometimes not even when adding a new chart, is there any way to debug since there is no exceptions