6
मुझे समझने में बहुत मुश्किल समय है कि वास्तव में लाइवचेर्ट्स के साथ क्या हो रहा है।लाइवचर्ट्स की मूल बातें - मैं एक रेखा कैसे आकर्षित करूं?
<Grid>
<Grid.Background>
<ImageBrush ImageSource="/CPF;component/Images/background-top-cropped2.png" Stretch="None"></ImageBrush>
</Grid.Background>
<lvc:CartesianChart Series="{Binding myData}" LegendLocation="Right" x:Name="myChart">
<lvc:CartesianChart.AxisY>
<lvc:Axis Title="Sales" LabelFormatter="{Binding YFormatter}"></lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.AxisX>
<lvc:Axis Title="Month" Labels="{Binding Labels}"></lvc:Axis>
</lvc:CartesianChart.AxisX>
</lvc:CartesianChart>
</Grid>
और कोड के पीछे यहाँ:: 'myChart.Series.Add (mySeries)'
public MainWindow()
{
InitializeComponent();
DrawGraphs();
}
public void DrawGraphs()
{
LineSeries mySeries = new LineSeries
{
Values = new ChartValues<int> { 12, 23, 55, 1 }
};
myChart.Series.Add(mySeries);
}
रनटाइम पर, एक अशक्त संदर्भ अपवाद त्रुटि फेंकता मैं XAML के एक ब्लॉक यहाँ है। मुझे यकीन है कि इसे कैसे हल किया जाए?