XCharts Homepage
XCharts API
XCharts Configuration
QA 1: How to adjust the margin between the axis and the background?
QA 2: How to play agian the fadeIn animation?
QA 3: How to customize the color of data item in line chart and pie chart?
QA 4: How to formatter the text of axis label, such as add a units text?
QA 5: How to stack the bar of bar chart
QA 6: How to make the bar serie in the same bar but not stack?
QA 7: How to adjust the bar width and gap of barchart?
QA 8: How to adjust the color of bar?
QA 9: Can I adjust the anchor of chart?
QA 10: Can display more than 1000 data?
QA 11: Can line chart drawing be dash, dot and dash-dot?
QA 12: How to limit the value range of the Y-axis?
QA 13: How to customize the tick value range of value axis?
QA 14: How to display text at the top of data items?
QA 15: How do I customize icons for data items?
QA 16: How to anti-aliasing and make the chart smoother?
QA 17: Why does mouse over chart Tooltip not show?
QA 18: How not to display the bar line of Tooltip?
QA 19: How do I customize the display of Tooltip?
QA 20: How do I get the Y-axis to display multiple decimal places?
QA 21: How do I dynamically update data with code?
QA 22: How to display legend? Why are legends sometimes not displayed?
QA 23: How to make chart as prefab?
QA 24: How do I draw custom graphic in chart,such as line or dot?
QA 25: How to achieve similar data movement effect of ELECTRO cardiogram?
QA 26: How do I use the background component? What are the conditions?
QA 27: Mesh can not have more than 65000 vertices?
QA 28: Why are the parameters set in Serie reset after they run?
QA 29: Why are many custom colors lost after upgrading to 1.6.0? How should I upgrade?
A: Grid
conponent,which can adjust the left, right, up, down margins of chart.
A: call the chart.AnimationReset()
API.
A: Theme
->colorPalette
, or the sub component LineStyle
and ItemStyle
of Serie
.
A: Adjust formatter
and numericFormatter
parameter of Legend
, AxisLabel
, Tooltop
, SerieLabel
.
A: Set the stack
parameter of Serie
, the series will stack in a bar with the same stack
.
A: Set the barGap
of Serie
to -1
,stack
to null.
A: Adjust the barWidth
and barGap
parameter of Serie
, the last serie
's barWidth
and barGap
are valid when multiple serie
.
A: Adjust the ItemStyle
of Data
in inspector
.
A: Yes, you can set any one of 16 anchors but the value use default.
A: Yes. But UGUI
limits 65000
vertices to a single Graphic
, so too much data may not be displayed completely. The sampling simplification curve can be turned on by setting the sampling distance sampleDist
. You can also set some parameters to reduce the number of vertices in the chart to help show more data. Such as reducing the size of the chart, close or reduce the axis of the client drawing, close Symbol
and Label
display. A Normal
line chart occupies fewer vertices than a Smooth
line chart. The 1.5.0
and above versions can set large
and largeThreshold
parameters to enable performance mode.
A: Yes. Adjust the lineType
of Serie
.
A: Select the minMaxType
of Axis
as Custom
, then set min
and max
to the values you want.
A: By default, it is automatically split by the splitNumber
of Axis
. Also, you can customize the interval
to the range you want.
A: Adjust the Label
of Serie
.
A: Set the Icon
of Data
in Serie
.
A: Open the Anti-Aliasing
setting in Unity
. Selected the UI Canvas Render Mode
as Screen Space-Camera
, selected MSAA
, set 4
times or higher anti-aliasing. The sawtooth can only be reduced and unavoidable. The higher the pixel, the less obvious the sawtooth is.
A: Verify Toolip
is opened. Verify that the parent node of chart has turned off mouse events.
A: Set the type
of Tooltup
as None
. Or adjust the parameters of lineStyle
.
A: See the formatter
, itemFormatter
, titleFormatter
parameters of Tooltip
.
A: Set the numericFormatter
parameter of AxisLabel
.
A: See example: Example01_UpdateData.cs
A: First, the name
in Serie
must have a value that is not null. Then set Legend
is show
, where data
can be empty by default, indicating that all legends are displayed. If you only want to display part of the Serie
legend, fill in data
with the name
of the legend you want to display. If none of the values in data
are name
of the series, the legend will not be displayed.
A: Before make prefab, please delete all sub gameObject under chart which auto-created by XCharts
.
A: Implement onCustomDraw
of chart, see Example12_CustomDrawing.cs
.
A: See Example_Dynamic.cs
.
A: Setting show
to true
for the background
component.
A: This is the limit of UGUI
on the number of vertices for a single Graphic
. XCharts
is draw chart on a single Graphic
, so there is also this limitation. The solution can be referred to: QA 10: Can display more than 1000 data
A: Check whether RemoveData()
and add new Serie
in the code. If you want to keep the configuration of Serie
, you can only ClearData()
which just clear data and then readd the data to the old serie.
A: In version 1.6.0
, in order to reduce implicit conversion, all drawing related Color
was changed to Color32
, so some custom colors were lost. The main components affected are: ItemStyle
, LineStyle
, AreaStyle
, Vessel
, VisualMap
, AxisSplitArea
, AxisSplitLine
, GaugeAxis
,SerieLabel
, etc. Can use the script UpgradeChartColor.cs to upgrade.
The upgrade steps are as follows:
Editor
, Change the color
field inside to color.clear
(because some fields may not exist in the old version).menu bar -> XCharts-> ExportColorConfig
(the configuration file is saved by default to color.config
under Assets
).XCharts
to the latest version.color.config
through menu bar -> XCharts-> ImportColorConfig
(if color.config
is not under Assets
of the upgraded project, copy it to this directory).