-3

I have tried to implement LiveCharts in vb.net project but unsuccessful. Tried searching the internet but unfurtunately found no sample code. What might be the problem in my code?sample code

    Private Sub InitializeChart()
    Dim labelPoint As Func(Of ChartPoint, String) = Function(chartPoint) String.Format("{0} ({1:P})", chartPoint.Y, chartPoint.Y, chartPoint.Participation)
    'pieChartMain = New LiveCharts.WinForms.PieChart
    Dim seriesCollection As SeriesCollection = New SeriesCollection
    Dim pieSeries1 As PieSeries = New PieSeries
    Dim pieSeries2 As PieSeries = New PieSeries
    pieSeries1.Title = "MALE"
    pieSeries1.Values = New ChartValues(Of Double) From {3}
    pieSeries1.PushOut = 15
    pieSeries1.DataLabels = True
    pieSeries1.LabelPoint = labelPoint

    pieSeries2.Title = "FEMALE"
    pieSeries2.Values = New ChartValues(Of Double) From {6}
    pieSeries2.DataLabels = True
    pieSeries2.LabelPoint = labelPoint

    seriesCollection.Add(pieSeries1)
    seriesCollection.Add(pieSeries2)
    pieChartMain.Series.Add(seriesCollection)

    pieChartMain.LegendLocation = LegendLocation.Bottom

    pieChartMain.Show()
End Sub

1 Answers1

1

I think the sample needs more information to someone try a help...

What is the PIE control name?

Are you IMPORTING the libraries?

Imports LiveCharts.WinForms
Imports LiveCharts.Wpf
Imports LiveCharts

After the last PieChart command, try to force the redraw. For instance, in a Gauge control, I get success if utilize:

Gauge.resumelayout

So, try to REFRESH and also RESUMELAYOUT over the control

David BS
  • 1,822
  • 1
  • 19
  • 35