XCharts-Team / XCharts

A charting and data visualization library for Unity. Unity数据可视化图表插件。
https://xcharts-team.github.io
MIT License
3.22k stars 557 forks source link

Code error:linechart.AddSerie<Line>("line") #324

Closed DHBAT closed 1 month ago

DHBAT commented 1 month ago

Refer to the provided XCharts tutorial: Get started with XCharts in 5 minutes. When using the code "linechart.AddSerie("line");", an error occurs. The error message is: Type "Line" cannot be used as type parameter "T" in generic type or method "BaseChart.AddSerie(string,bool,bool)". There is no implicit reference conversion from "Line" to "XCharts.Runtime.Serie". How can I solve this problem? Here is my complete screenshot: code_error completeCode

DHBAT commented 1 month ago

Refer to the provided XCharts tutorial: Get started with XCharts in 5 minutes. When using the code "linechart.AddSerie("line");", an error occurs. The error message is: Type "Line" cannot be used as type parameter "T" in generic type or method "BaseChart.AddSerie(string,bool,bool)". There is no implicit reference conversion from "Line" to "XCharts.Runtime.Serie". How can I solve this problem? Here is my complete screenshot: code_error completeCode

error_message

monitor1394 commented 1 month ago

XCharts 2.x

chart.AddSerie(SerieType.Line, "Line");

XCharts 3.x chart.AddSerie<Line>("Line");

You might need to confirm which version of XCharts you are currently using.