Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 21 additions & 31 deletions wpf/Charts/CodedUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,35 +106,32 @@ Once the record is completed, click the GenerateCode icon in CodedUITestBuilder
{% highlight c# %}


public void RecordedMethod1()

{

#region Variable Declarations

WpfSfChart uISfChartCustom = this.UICUITestSampleDemoWindow.UISfChartCustom;
public void RecordedMethod1()
{
#region Variable Declarations

WpfChartSeries uIColumnSeriesCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIColumnSeriesCustom;
WpfSfChart uISfChartCustom = this.UICUITestSampleDemoWindow.UISfChartCustom;

WpfLegend uIChartLegendCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIChartLegendCustom;
WpfChartSeries uIColumnSeriesCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIColumnSeriesCustom;

WpfChartAxis uINumericalAxisCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UINumericalAxisCustom;
WpfLegend uIChartLegendCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIChartLegendCustom;

WpfChartAxis uICategoryAxisCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UICategoryAxisCustom;
WpfChartAxis uINumericalAxisCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UINumericalAxisCustom;

WpfZoomingBehavior uIZoomInCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomInCustom;
WpfChartAxis uICategoryAxisCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UICategoryAxisCustom;

WpfZoomingBehavior uIZoomOutCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomOutCustom;
WpfZoomingBehavior uIZoomInCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomInCustom;

WpfZoomingBehavior uIZoomResetCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomResetCustom;
WpfZoomingBehavior uIZoomOutCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomOutCustom;

WpfZoomingBehavior uIZoomPanCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomPanCustom;
WpfZoomingBehavior uIZoomResetCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomResetCustom;

WpfZoomingBehavior uISelectionZoomCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UISelectionZoomCustom;
WpfZoomingBehavior uIZoomPanCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIZoomPanCustom;

#endregion
WpfZoomingBehavior uISelectionZoomCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UISelectionZoomCustom;

}
#endregion
}

{% endhighlight %}

Expand Down Expand Up @@ -164,21 +161,14 @@ Click Generate code icon to generate assertion code then close the builder if va
{% highlight c# %}

public void AssertMethod1()

{

#region Variable Declarations

WpfChartSeries uIColumnSeriesCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIColumnSeriesCustom;

#endregion

// Verify that the 'SegmentsCount' property of 'ColumnSeries' custom control equals '10'

Assert.AreEqual(this.AssertMethod1ExpectedValues.UIColumnSeriesCustomSegmentsCount, uIColumnSeriesCustom.SegmentsCount, "Segemnts Count Mismatched...");

#region Variable Declarations
WpfChartSeries uIColumnSeriesCustom = this.UICUITestSampleDemoWindow.UISfChartCustom.UIColumnSeriesCustom;
#endregion

// Verify that the 'SegmentsCount' property of 'ColumnSeries' custom control equals '10'
Assert.AreEqual(this.AssertMethod1ExpectedValues.UIColumnSeriesCustomSegmentsCount, uIColumnSeriesCustom.SegmentsCount, "Segemnts Count Mismatched...");
}

{% endhighlight %}

## Run Tests
Expand Down
23 changes: 7 additions & 16 deletions wpf/Charts/How-To/Export-Chart-to-Image-Windows-8-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,16 @@ chart.Save("sfchart.jpg", KnownFolders.PicturesLibrary);
{% highlight c# %}
var memoryStream = new InMemoryRandomAccessStream();

chart.Save(memoryStream, BitmapEncoder.BmpEncoderId);
chart.Save(memoryStream, BitmapEncoder.BmpEncoderId);

StorageFolder storageFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;

var file = await storageFolder.CreateFileAsync("chartwithstream.jpg", CreationCollisionOption.GenerateUniqueName);

StorageFolder storageFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;



var file = await storageFolder.CreateFileAsync("chartwithstream.jpg", CreationCollisionOption.GenerateUniqueName);



var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);

{

chart.Save(stream, BitmapEncoder.BmpEncoderId);

}
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);
{
chart.Save(stream, BitmapEncoder.BmpEncoderId);
}

{% endhighlight %}

31 changes: 11 additions & 20 deletions wpf/Charts/How-To/Serialize-the-SfChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ XAML
{% highlight xaml %}

<chart:SfChart x:Name=chart>

<chart:ColumnSeries ItemsSource="{Binding CategoricalDatas}" XBindingPath="Category" YBindingPath="Value" Palette="RedChrome"/>

<chart:ColumnSeries
ItemsSource="{Binding CategoricalDatas}"
XBindingPath="Category"
YBindingPath="Value"
Palette="RedChrome"/>
</chart:SfChart>

<StackPanel>

<Button x:Name="Serialize" Content="Serialize" Height="50" Width="100" Margin="10" Click="Serialize_Click"/>

<Button x:Name="Deserialize" Content="Deserialize" Height="50" Width="100" Margin="10" Click="Deserialize_Click"/>

<Button x:Name="Serialize" Content="Serialize" Height="50" Width="100" Margin="10" Click="Serialize_Click"/>
<Button x:Name="Deserialize" Content="Deserialize" Height="50" Width="100" Margin="10" Click="Deserialize_Click"/>
</StackPanel>

{% endhighlight %}
Expand All @@ -70,23 +69,15 @@ C#
{% highlight c# %}

private void Serialize_Click(object sender, RoutedEventArgs e)

{

string filePath = @"E:/Documents/chart.xml";

chart.Serialize(filePath);

string filePath = @"E:/Documents/chart.xml";
chart.Serialize(filePath);
}

private void Deserialize_Click(object sender, RoutedEventArgs e)

{

string filePath = @"E:/Documents/chart.xml";

var deserializedChart = (SfChart)chart.Deserialize();

string filePath = @"E:/Documents/chart.xml";
var deserializedChart = (SfChart)chart.Deserialize();
}

{% endhighlight %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,20 @@ SfChart offers two utility methods for converting your data points into pixel va
{% highlight c# %}

private void LineChart_MouseMove(object sender, MouseEventArgs e)

{

Point mousePoint = new Point

{

X = e.GetPosition(LineChart).X - LineChart.SeriesClipRect.Left - LineChart.Margin.Left,

Y = e.GetPosition(LineChart).Y - LineChart.SeriesClipRect.Top - LineChart.Margin.Top

};



  // Converts mouse co-ordinate points into a value related to ChartAxis.



double xValue = this.LineChart.PointToValue(this.LineChart.PrimaryAxis, mousePoint);

double yValue = this.LineChart.PointToValue(this.LineChart.SecondaryAxis, mousePoint);





            // Converts the data point value of the chart to Chart coordinate.

            double chartPointX = this.LineChart.ValueToPoint(this.LineChart.PrimaryAxis, xValue);

            double chartPointY = this.LineChart.ValueToPoint(this.LineChart.SecondaryAxis, yValue);



}

{
Point mousePoint = new Point
{
X = e.GetPosition(LineChart).X - LineChart.SeriesClipRect.Left - LineChart.Margin.Left,
Y = e.GetPosition(LineChart).Y - LineChart.SeriesClipRect.Top - LineChart.Margin.Top
};

// Converts mouse co-ordinate points into a value related to ChartAxis.
double xValue = this.LineChart.PointToValue(this.LineChart.PrimaryAxis, mousePoint);
double yValue = this.LineChart.PointToValue(this.LineChart.SecondaryAxis, mousePoint);

// Converts the data point value of the chart to Chart coordinate.
double chartPointX = this.LineChart.ValueToPoint(this.LineChart.PrimaryAxis, xValue);
double chartPointY = this.LineChart.ValueToPoint(this.LineChart.SecondaryAxis, yValue);
}

{% endhighlight %}
Loading