willdale / SwiftUICharts

A charts / plotting library for SwiftUI. Works on macOS, iOS, watchOS, and tvOS and has accessibility features built in.
MIT License
844 stars 105 forks source link

Customize blank caption #77

Closed wyk111wyk closed 3 years ago

wyk111wyk commented 3 years ago

So far the blank caption is "No Data" for table chart, can you make it customizable, so we can localize this hint. 截屏2021-05-18 上午11 09 10

willdale commented 3 years ago

It is customisable.

LineChartData(...,
              noDataText: Text("Hello World."))
wyk111wyk commented 3 years ago

Thx for your response, this is great, but I have another question: Is the width between two nodes customizable? IMG_7232

willdale commented 3 years ago

No, what you could do is, not provide a label for every other data point;

LineChartDataPoint(value: 12000, xAxisLabel: "1"),
LineChartDataPoint(value: 10000),
LineChartDataPoint(value: 8000, xAxisLabel: "3"),
LineChartDataPoint(value: 17500),
...