Xamarin.Android MPAndroidChart c# 版本 RoundBarChart

Xamarin.Android MPAndroidChart c# version RoundBarChart

我目前正在使用 MPAndroidChart in C# via Nuget

我尝试使用此参考构建 RoundedBarChart WW-Digital/MPAndroidChart

但是问题有些methods/variables例如:

此行 setBarSpace 已存在。参考 MPAndroidChart

// initialize the buffer
    BarBuffer buffer = mBarBuffers[index];
    buffer.setPhases(phaseX, phaseY);
    buffer.setBarSpace(dataSet.getBarSpace());
    buffer.setDataSet(index);
    buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));

在 C# 中 MPAndroidChart in C# via Nuget

  // initialize the buffer
        BarBuffer buffer = BarBuffers[index];
        buffer.SetPhases(phaseX, phaseY);
        ///buffer.Bar(dataSet.getBarSpace());
        buffer.SetDataSet(index);
        buffer.SetInverted(Chart.IsInverted(dataSet.AxisDependency));

不存在 BarSpace 变量或方法。 java和c#版本是一样的3.0.2

如果我遗漏了什么,请提供我对此的见解。

MPAndroidChart in C# via Nuget is different from the WW-Digital/MPAndroidChart.

MPAndroidChart.Xamarin nuget you are using is a Xamarin.Android binding for MPAndroidChart by Philipp Jahoda. So you should refer to this example.

There is no BarSpace variable or method that is existing.

您可以使用 buffer.SetBarWidth() 方法,用法如下:

protected IBarDataProvider mChart;

...

buffer.SetBarWidth(mChart.BarData.BarWidth);

你可以参考BarChartRenderer