Error when trying to reference DataPoint Class

edited August 31 in FastReport .NET

Hi,

In a MSChart object I have a series with a lot of data points. So many, that the dashed border style does not work. I'm currently trying to draw custom dashed lines in an MSChart series with a solution I found here.

It seems like FastReport.DataVisualization.dll is a wrapper for System.Windows.Forms.DataVisualization. This is listed as a referenced assembly in Report > Options > Script. I included a namespace reference to FastReport.DataVisualization and FastReport.DataVisualization.Charting.

Despite this, when I try to access the DataPoints in a Series:

private void MyGetPointsMethod(Series series)

  {     

   foreach(var dp in series.Points)

   {

    double dx = dp.XValue;

    double dy = dp.YValue;

   }


I get the following error message:

(44,24): Error CS1061: 'FastReport.DataVisualization.Charting.DataPoint' does not contain a definition for 'YValue' and no extension method 'YValue' accepting a first argument of type 'FastReport.DataVisualization.Charting.DataPoint' could be found (are you missing a using directive or an assembly reference?)

A reference to DataPoint should work as was posted here.

What am I missing here?

Comments

  • I found my mistake!

    The correct property name is YValues and contains all values assigned to a DataPoint.

    double dy = dp.YValues[0];
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.