Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142962 | Feb 27,2019 03:50 AM UTC | Feb 27,2019 07:17 AM UTC | UWP | 1 |
![]() |
Tags: SfChart |
//We have added buy value in 0th index.
var buys = (int)viewModel.Data[0].TotalBuys;
Random rd = new Random();
double y1;
for (int i = 0; i < 6; i++)
{
//Set each buy value
if (buys > 0)
y1 = rd.Next(0, buys);
else
y1 = rd.Next(buys, 0);
LineAnnotation line = new LineAnnotation()
{
X1 = 2.6,//We have set jan month in 3rd index, so that we have set mid point for X1 and X2
X2 = 3.4,
Y1 = y1,
Y2 = y1,
Stroke = new SolidColorBrush(Colors.White)
};
chart.Annotations.Add(line);
} |
<chart:StackingColumnSeries XBindingPath="Month" YBindingPath="Sells"
StrokeThickness="2" Stroke="Transparent"
Label="Sells"
ItemsSource="{Binding Data}"/>
<chart:StackingColumnSeries XBindingPath="Month" YBindingPath="Income"
Label="Income"
StrokeThickness="2" Stroke="Transparent"
ItemsSource="{Binding Data}"/>
<chart:StackingColumnSeries XBindingPath="Month" YBindingPath="Expenses"
Label="Expenses"
StrokeThickness="2" Stroke="Transparent"
ItemsSource="{Binding Data}"/>
<chart:StackingColumnSeries XBindingPath="Month" YBindingPath="Buys"
Label="Buys"
StrokeThickness="2" Stroke="Transparent"
ItemsSource="{Binding Data}"/> |
<chart:SfChart.Annotations>
<chart:HorizontalLineAnnotation Y1="0" Stroke="Black"/>
</chart:SfChart.Annotations> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.