I need to implement candlestick charts in windows metro app.Im not looking for any chart controls like visfire..ineed an open source code or a way ow to build it...Please help me...
Asked
Active
Viewed 2,132 times
0

Farhan Ghumra
- 15,180
- 6
- 50
- 115

Sudeep george
- 111
- 1
- 11
-
Do you need [this](http://prntscr.com/yzqh8) kind of chart ? – Farhan Ghumra Apr 03 '13 at 09:59
-
Is this a JavaScript question? – Jerry Nixon Apr 03 '13 at 15:15
2 Answers
3
OxyPlot is an open source, cross-platform .NET plotting library. It is available for WPF, Windows Store Apo, Silverlight & Windows Forms.
CodePlex Page : http://oxyplot.codeplex.com/
NuGet Package (You must have installed NuGet v2.1 or more) : http://nuget.org/List/Packages/OxyPlot.Metro
Sample App : http://apps.microsoft.com/webpdp/app/oxyplot-example-browser/95b37c05-f2b0-4186-b48e-01b6fcbeec5d
Here I am giving you demo of how to use candle stick series chart in Windwos store app
XAML
I have taken xmlns:oxy="using:OxyPlot.Metro" in
tag
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<oxy:Plot x:Name="Plot1" Background="White"/>
</Grid>
C#
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Plot1.Model = CandleStickSeries();
}
public PlotModel CandleStickSeries()
{
PlotModel plotModel = new PlotModel("Candle Stick Series", null)
{
LegendSymbolLength = 24.0
};
CandleStickSeries candleStickSeries = new CandleStickSeries("random values")
{
Color = OxyColors.Black
};
Random random = new Random();
double num = 100.0;
for (int i = 0; i < 16; i++)
{
num = num + random.NextDouble() + 0.1;
double num2 = num + 10.0 + random.NextDouble() * 10.0;
double num3 = num - (10.0 + random.NextDouble() * 10.0);
double open = num3 + random.NextDouble() * (num2 - num3);
double close = num3 + random.NextDouble() * (num2 - num3);
candleStickSeries.Items.Add(new HighLowItem((double)i, num2, num3, open, close));
}
plotModel.Series.Add(candleStickSeries);
plotModel.Axes.Add(new LinearAxis(AxisPosition.Left, double.NaN, double.NaN, null)
{
MaximumPadding = 0.3,
MinimumPadding = 0.3
});
return plotModel;
}

Farhan Ghumra
- 15,180
- 6
- 50
- 115
1
This is the only open source chart implementation for WindowsPhone I know: amCharts
HTH

paiden
- 887
- 7
- 15
-
The question is regarding Windows Store App, not for Silverlight, WPF or Windows Phone – Farhan Ghumra Apr 03 '13 at 10:06
-
Yep you're right. I think, I was still in WinPhone context from another question. – paiden Apr 03 '13 at 10:09
-
-
I dont think it is fully compatible. But you should get a lot of information on how to draw charts in ModernUI apps by looking at the source code. Many classes used in amCharts to draw the charts on WindowsPhone also exist in XAML ModernUI Framework (Canvas, Brush...). – paiden Apr 03 '13 at 10:19