mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
更新文档
This commit is contained in:
@@ -3,7 +3,7 @@ sidebar_position: 41
|
||||
slug: /api
|
||||
---
|
||||
|
||||
# Chart API
|
||||
# API
|
||||
|
||||
## All Class
|
||||
|
||||
@@ -2347,7 +2347,7 @@ public void UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0)
|
||||
|
||||
## BaseGraph
|
||||
|
||||
class in XCharts.Runtime / Inherits from: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent)
|
||||
class in XCharts.Runtime / Inherits from: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler), / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent)
|
||||
|
||||
### BaseGraph.chartHideFlags
|
||||
|
||||
@@ -5858,7 +5858,7 @@ class in / Subclasses: [XLog](#xlog)
|
||||
|
||||
## ObjectPool<T> where T
|
||||
|
||||
class in XCharts.Runtime / Inherits from: [new()](#new())
|
||||
class in XCharts.Runtime / Inherits from: new()
|
||||
|
||||
### ObjectPool<T> where T.countActive
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# 更新日志
|
||||
# Changelog
|
||||
|
||||
[master](#master)
|
||||
[v3.12.0](#v3120)
|
||||
@@ -153,7 +153,7 @@ Changelog Details:
|
||||
## v3.10.2
|
||||
|
||||
* (2024.03.11) Release `v3.10.2`
|
||||
* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting {d} (#304)
|
||||
* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting `{d}` (#304)
|
||||
* (2024.03.11) Fix to `Tooltip` still showing after moving out of coordinate system
|
||||
* (2024.03.08) Fixed an issue where `Tooltip`'s title might not appear after upgrading from an older version
|
||||
|
||||
@@ -629,7 +629,7 @@ Details:
|
||||
* (2022.03.20) Release `v2.7.0` version
|
||||
* (2022.02.21) Fixed chart name repeat check error #183
|
||||
* (2022.02.17) Fixed bug where axis split line might be displayed outside the coordinate system #181
|
||||
* (2022.02.08) Fixed {d} formatter error when value is 0
|
||||
* (2022.02.08) Fixed `{d}` formatter error when value is 0
|
||||
* (2022.02.08) Fixed `YAxis` `AxisLabel`'s `onZero` does not work
|
||||
* (2022.01.06) Improved `Zebra` bar chart
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
sidebar_position: 31
|
||||
slug: /configuration
|
||||
---
|
||||
# Chart Configuration
|
||||
# Configuration
|
||||
|
||||
## Serie
|
||||
|
||||
|
||||
@@ -1,155 +1,122 @@
|
||||
# XCharts FAQ
|
||||
# FAQ
|
||||
|
||||
[FAQ 1: How to adjust the margin between the axis and the background?](#how-to-adjust-the-margin-between-the-axis-and-the-background)
|
||||
[FAQ 2: How to play agian the fadeIn animation?](#how-to-play-agian-the-fadein-animation)
|
||||
[FAQ 3: How to customize the color of data item in line chart and pie chart?](#how-to-customize-the-color-of-data-item-in-line-chart-and-pie-chart)
|
||||
[FAQ 4: How to formatter the text of axis label, such as add a units text?](#how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text)
|
||||
[FAQ 5: How to stack the bar of bar chart](#how-to-stack-the-bar-of-bar-chart)
|
||||
[FAQ 6: How to make the bar serie in the same bar but not stack?](#how-to-make-the-bar-serie-in-the-same-bar-but-not-stack)
|
||||
[FAQ 7: How to adjust the bar width and gap of barchart?](#how-to-adjust-the-bar-width-and-gap-of-barchart)
|
||||
[FAQ 8: How to adjust the color of bar?](#how-to-adjust-the-color-of-bar)
|
||||
[FAQ 9: Can I adjust the anchor of chart?](#can-i-adjust-the-anchor-of-chart)
|
||||
[FAQ 10: Can display more than 1000 data?](#can-display-more-than-1000-data)
|
||||
[FAQ 11: Can line chart drawing be dash, dot and dash-dot?](#can-line-chart-drawing-be-dash-dot-and-dash-dot)
|
||||
[FAQ 12: How to limit the value range of the Y-axis?](#how-to-limit-the-value-range-of-the-y-axis)
|
||||
[FAQ 13: How to customize the tick value range of value axis?](#how-to-customize-the-tick-value-range-of-value-axis)
|
||||
[FAQ 14: How to display text at the top of data items?](#how-to-display-text-at-the-top-of-data-items)
|
||||
[FAQ 15: How do I customize icons for data items?](#how-do-i-customize-icons-for-data-items)
|
||||
[FAQ 16: How to anti-aliasing and make the chart smoother?](#how-to-anti-aliasing-and-make-the-chart-smoother)
|
||||
[FAQ 17: Why does mouse over chart Tooltip not show?](#why-does-mouse-over-chart-tooltip-not-show)
|
||||
[FAQ 18: How not to display the bar line of Tooltip?](#how-not-to-display-the-bar-line-of-tooltip)
|
||||
[FAQ 19: How do I customize the display of Tooltip?](#how-do-i-customize-the-display-of-tooltip)
|
||||
[FAQ 20: How do I get the Y-axis to display multiple decimal places?](#how-do-i-get-the-y-axis-to-display-multiple-decimal-places)
|
||||
[FAQ 21: How do I dynamically update data with code?](#how-do-i-dynamically-update-data-with-code)
|
||||
[FAQ 22: How to display legend? Why are legends sometimes not displayed?](#how-to-display-legend-why-are-legends-sometimes-not-displayed)
|
||||
[FAQ 23: How to make chart as prefab?](#how-to-make-chart-as-prefab)
|
||||
[FAQ 24: How do I draw custom graphic in chart,such as line or dot?](#how-do-i-draw-custom-content-in-chart-such-as-line-or-dot)
|
||||
[FAQ 25: How to achieve similar data movement effect of ELECTRO cardiogram?](#how-to-achieve-similar-data-movement-effect-of-electro-cardiogram)
|
||||
[FAQ 26: How do I use the background component? What are the conditions?](#how-do-i-use-the-background-component-what-are-the-conditions)
|
||||
[FAQ 27: Mesh can not have more than 65000 vertices?](#mesh-cannot-have-more-than-65000-vertices)
|
||||
[FAQ 28: Why are the parameters set in Serie reset after they run?](#why-are-the-parameters-set-in-serie-reset-after-they-run)
|
||||
[FAQ 29: How to change the color of serie symbol?](#how-to-change-the-color-of-serie-symbol)
|
||||
[FAQ 30: How to deal with TMP errors when importing or updating XCharts?](#what-if-tmp-errors-occur-when-importing-or-updating-xcharts)
|
||||
[FAQ 31: Support empty data? How to achieve the effect of line chart disconnection?](#support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection)
|
||||
[FAQ 32: 2.x What are the common problems when upgrading version 3.x?](#what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3)
|
||||
|
||||
## how-to-adjust-the-margin-between-the-axis-and-the-background
|
||||
## FAQ 1: How to adjust the margin between the axis and the background?
|
||||
|
||||
`Grid` conponent,which can adjust the left, right, up, down margins of chart.
|
||||
|
||||
## how-to-play-agian-the-fadein-animation
|
||||
## FAQ 2: How to play agian the fadeIn animation?
|
||||
|
||||
call the `chart.AnimationReset()` API.
|
||||
|
||||
## how-to-customize-the-color-of-data-item-in-line chart-and-pie-chart
|
||||
## FAQ 3: How to customize the color of data item in line chart and pie chart?
|
||||
|
||||
`Theme`->`colorPalette`, or the sub component `LineStyle` and `ItemStyle` of `Serie`.
|
||||
|
||||
## how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text
|
||||
## FAQ 4: How to formatter the text of axis label, such as add a units text?
|
||||
|
||||
Adjust `formatter` and `numericFormatter` parameter of `Legend`, `AxisLabel`, `Tooltop`, `SerieLabel`.
|
||||
|
||||
## how-to-stack-the-bar-of-bar-chart
|
||||
## FAQ 5: How to stack the bar of bar chart?
|
||||
|
||||
Set the `stack` parameter of `Serie`, the series will stack in a bar with the same `stack`.
|
||||
|
||||
## how-to-make-the-bar-serie-in-the-same-bar-but-not-stack
|
||||
## FAQ 6: How to make the bar serie in the same bar but not stack?
|
||||
|
||||
Set the `barGap` of `Serie` to `-1`,`stack` to null.
|
||||
|
||||
## how-to-adjust-the-bar-width-and-gap-of-barchart
|
||||
## FAQ 7: How to adjust the bar width and gap of barchart?
|
||||
|
||||
Adjust the `barWidth` and `barGap` parameter of `Serie`, the last `serie`'s `barWidth` and `barGap` are valid when multiple `serie`.
|
||||
|
||||
## how-to-adjust-the-color-of-bar
|
||||
## FAQ 8: How to adjust the color of bar?
|
||||
|
||||
Adjust the `ItemStyle` of `Data` in `inspector`.
|
||||
|
||||
## can-i-adjust-the-anchor-of-chart
|
||||
## FAQ 9: Can I adjust the anchor of chart?
|
||||
|
||||
Yes, you can set any one of 16 anchors but the value use default.
|
||||
|
||||
## can-display-more-than-1000-data
|
||||
## FAQ 10: Can display more than 1000 data?
|
||||
|
||||
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.
|
||||
|
||||
## can-line-chart-drawing-be-dash-dot-and-dash-dot
|
||||
## FAQ 11: Can line chart drawing be dash, dot and dash-dot?
|
||||
|
||||
Yes. Adjust the `lineType` of `Serie`.
|
||||
|
||||
## how-to-limit-the-value-range-of-the-y-axis
|
||||
## FAQ 12: How to limit the value range of the Y-axis?
|
||||
|
||||
Select the `minMaxType` of `Axis` as `Custom`, then set `min` and `max` to the values you want.
|
||||
|
||||
## how-to-customize-the-tick-value-range-of-value-axis
|
||||
## FAQ 13: How to customize the tick value range of value axis?
|
||||
|
||||
By default, it is automatically split by the `splitNumber` of `Axis`. Also, you can customize the `interval` to the range you want.
|
||||
|
||||
## how-to-display-text-at-the-top-of-data-items
|
||||
## FAQ 14: How to display text at the top of data items?
|
||||
|
||||
Adjust the `Label` of `Serie`.
|
||||
|
||||
## how-do-i-customize-icons-for-data-items
|
||||
## FAQ 15: How do I customize icons for data items?
|
||||
|
||||
Set the `Icon` of `Data` in `Serie`.
|
||||
|
||||
## how-to-anti-aliasing-and-make-the-chart-smoother
|
||||
## FAQ 16: How to anti-aliasing and make the chart smoother?
|
||||
|
||||
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.
|
||||
|
||||
## why-does-mouse-over-chart-tooltip-not-show
|
||||
## FAQ 17: Why does mouse over chart Tooltip not show?
|
||||
|
||||
Verify `Toolip` is opened. Verify that the parent node of chart has turned off mouse events.
|
||||
|
||||
## how-not-to-display-the-bar-line-of-tooltip
|
||||
## FAQ 18: How not to display the bar line of Tooltip?
|
||||
|
||||
Set the `type` of `Tooltup` as `None`. Or adjust the parameters of `lineStyle`.
|
||||
|
||||
## how-do-i-customize-the-display-of-tooltip
|
||||
## FAQ 19: How do I customize the display of Tooltip?
|
||||
|
||||
See the `formatter`, `itemFormatter`, `titleFormatter` parameters of `Tooltip`.
|
||||
|
||||
## how-do-i-get-the-y-axis-to-display-multiple-decimal-places
|
||||
## FAQ 20: How do I get the Y-axis to display multiple decimal places?
|
||||
|
||||
Set the `numericFormatter` parameter of `AxisLabel`.
|
||||
|
||||
## how-do-i-dynamically-update-data-with-code
|
||||
## FAQ 21: How do I dynamically update data with code?
|
||||
|
||||
See example: `Example01_UpdateData.cs`
|
||||
|
||||
## how-to-display-legend-why-are-legends-sometimes-not-displayed
|
||||
## FAQ 22: How to display legend? Why are legends sometimes not displayed?
|
||||
|
||||
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.
|
||||
|
||||
## how-to-make-chart-as-prefab
|
||||
## FAQ 23: How to make chart as prefab?
|
||||
|
||||
Before make prefab, please delete all sub gameObject under chart which auto-created by `XCharts`.
|
||||
|
||||
## how-do-i-draw-custom-content-in-chart-such-as-line-or-dot
|
||||
## FAQ 24: How do I draw custom graphic in chart,such as line or dot?
|
||||
|
||||
Implement `onCustomDraw` of chart, see `Example12_CustomDrawing.cs`.
|
||||
|
||||
## how-to-achieve-similar-data-movement-effect-of-electro-cardiogram
|
||||
## FAQ 25: How to achieve similar data movement effect of ELECTRO cardiogram?
|
||||
|
||||
See `Example_Dynamic.cs`.
|
||||
|
||||
## how-do-i-use-the-background-component-what-are-the-conditions
|
||||
## FAQ 26: How do I use the background component? What are the conditions?
|
||||
|
||||
Setting `show` to `true` for the `background` component.
|
||||
|
||||
## mesh-cannot-have-more-than-65000-vertices
|
||||
## FAQ 27: Mesh can not have more than 65000 vertices?
|
||||
|
||||
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: [FAQ 10: Can display more than 1000 data](#can-display-more-than-1000-data)
|
||||
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: [FAQ 10: Can display more than 1000 data?](#FAQ-10-can-display-more-than-1000-data)
|
||||
|
||||
## why-are-the-parameters-set-in-serie-reset-after-they-run
|
||||
## FAQ 28: Why are the parameters set in Serie reset after they run?
|
||||
|
||||
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.
|
||||
|
||||
## how-to-change-the-color-of-serie-symbol
|
||||
## FAQ 29: How to change the color of serie symbol?
|
||||
|
||||
The color of 'Symbol' is the color of 'ItemStyle' used.
|
||||
|
||||
## what-if-tmp-errors-occur-when-importing-or-updating-xcharts
|
||||
## FAQ 30: How to deal with TMP errors when importing or updating XCharts?
|
||||
|
||||
XCharts does not enable TMP by default, so there are no references to TMP on asmdef. This issue may occur when updating XCharts after TMP is enabled locally. It can be solved in the following two ways:
|
||||
|
||||
@@ -158,11 +125,23 @@ XCharts does not enable TMP by default, so there are no references to TMP on asm
|
||||
|
||||
Version ` 3.8.0 ` after adding Daemon [XCharts - Daemon](https://github.com/XCharts-Team/XCharts-Daemon), will be XCharts - Daemon import project, When updating XCharts, the daemon automatically refreshes the asmdef based on the locally enabled TMP to ensure proper compilation.
|
||||
|
||||
## support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection
|
||||
## FAQ 31: Support empty data? How to achieve the effect of line chart disconnection?
|
||||
|
||||
`data` of `Serie` is of type `double`, so it cannot represent empty data. Empty data can be achieved by turning on Serie's ignore and specifying ignoreValue. You can also set the ignore parameter for each SerieData. The ignoreLineBreak parameter can be set to disconnect or connect after ignoring data.
|
||||
|
||||
## what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3
|
||||
## FAQ 32: 2.x What are the common problems when upgrading version 3.x?
|
||||
|
||||
1. `XCharts.Runtime.XChartsMgr` is missing the class attribute `ExtensionOfNativeClass`!
|
||||
3.x version does not need to mount XChartsMgr, directly delete the `_xcharts_` node on the scene.
|
||||
|
||||
## FAQ 33: How to display a line chart without white space on both sides and start from the 0 coordinate?
|
||||
|
||||
Set the `boundaryGap` parameter of the X-axis.
|
||||
|
||||
## FAQ 34: How to set some Series not to display Tooltips?
|
||||
|
||||
Setting the `itemFormatter` of `itemStyle` in `serie` to `'-'` can ignore `tooltip`.
|
||||
|
||||
## FAQ 35: Sometimes an overlapping line appears in the area line chart when using semi-transparent colors
|
||||
|
||||
This is a bug in the drawing of the area line chart. You can use light opaque colors instead of semi-transparent colors.
|
||||
|
||||
9
Documentation~/en/support.md
Normal file
9
Documentation~/en/support.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: Support
|
||||
sidebar_position: 51
|
||||
slug: /support
|
||||
---
|
||||
|
||||
# Support
|
||||
|
||||
For technical support and to purchase additional charts, you can subscribe to the `VIP` service. For details, please send an email to `monitor1394@gmail.com` for consultation.
|
||||
@@ -1,13 +1,16 @@
|
||||
---
|
||||
title: Getting Started with XCharts 3.0 in 5 Minutes
|
||||
title: Getting Started
|
||||
sidebar_position: 11
|
||||
slug: /tutorial01
|
||||
---
|
||||
|
||||
# Getting Started with XCharts 3.0 in 5 Minutes
|
||||
# Getting Started with XCharts in 5 Minutes
|
||||
|
||||
:::warning
|
||||
|
||||
> Note: This tutorial is only applicable to the XCharts 3.x version. For the 2.x version, please refer to [Tutorial: Mastering XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/Tutorial%3A5-Minute-Start-to-XCharts.md)
|
||||
Note: This tutorial is only applicable to the XCharts 3.x version. For the 2.x version, please refer to [Tutorial: Mastering XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md)
|
||||
|
||||
:::
|
||||
|
||||
## Prerequisites for XCharts
|
||||
|
||||
@@ -55,7 +58,11 @@ The import method of XCharts-Daemon can refer to the previous import method of X
|
||||
|
||||
After importing XCharts and compiling, the XCharts menu will appear in the Unity editor's menu bar, and you can start using XCharts.
|
||||
|
||||
>Note: The XCharts menu in the Unity menu bar indicates that XCharts is available.
|
||||
:::tip
|
||||
|
||||
Note: The XCharts menu in the Unity menu bar indicates that XCharts is available.
|
||||
|
||||
:::
|
||||
|
||||
### Adding a Simple Chart
|
||||
|
||||
@@ -86,7 +93,11 @@ In the `Inspector` view, find the `LineChart` panel, and click the `Add Serie` b
|
||||

|
||||

|
||||
|
||||
>Note: Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/docs/configuration#serie-系列)
|
||||
:::tip
|
||||
|
||||
Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/docs/configuration#serie-系列)
|
||||
|
||||
:::
|
||||
|
||||
### Adding Other Main Components
|
||||
|
||||
@@ -94,7 +105,11 @@ By default, the chart does not have a `Legend`. If you need a `Legend` component
|
||||
|
||||

|
||||
|
||||
>Note: Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件)
|
||||
:::tip
|
||||
|
||||
Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件)
|
||||
|
||||
:::
|
||||
|
||||
### Adding Serie Components
|
||||
|
||||
@@ -103,7 +118,11 @@ Serie only comes with a few common components, and other components need to be a
|
||||

|
||||

|
||||
|
||||
>Note: Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件)
|
||||
:::tip
|
||||
|
||||
Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件)
|
||||
|
||||
:::
|
||||
|
||||
### Adding SerieData Components
|
||||
|
||||
@@ -112,7 +131,11 @@ If you need to customize the configuration of each data item individually, you c
|
||||

|
||||

|
||||
|
||||
>Note: SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件)
|
||||
:::tip
|
||||
|
||||
SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件)
|
||||
|
||||
:::
|
||||
|
||||
### More Components and Configuration Parameters
|
||||
|
||||
@@ -133,7 +156,11 @@ To quickly locate the component corresponding to the effect you want to change,
|
||||
2. If the `ItemStyle` of `Serie` has a color value other than `0000`, this color value is used.
|
||||
3. Otherwise, the color value is taken from the `Color Palette` of the theme `Theme`.
|
||||
|
||||
>Note: The color value is usually `0000` when using the default color of the theme; other parameters are `0` or null when using the default configuration of the theme; pay attention to transparency when setting colors.
|
||||
:::tip
|
||||
|
||||
The color value is usually `0000` when using the default color of the theme; other parameters are `0` or null when using the default configuration of the theme; pay attention to transparency when setting colors.
|
||||
|
||||
:::
|
||||
|
||||
### Adding a Line Chart with Code
|
||||
|
||||
@@ -214,7 +241,11 @@ Now, a simple line chart is ready:
|
||||
|
||||
If there are multiple series in a Chart, the data of Axis only needs to be added once, and should not be repeated in multiple loops.
|
||||
|
||||
>Remember: The number of Axis data should be consistent with the number of Serie data.
|
||||
:::tip
|
||||
|
||||
Remember: The number of Axis data should be consistent with the number of Serie data.
|
||||
|
||||
:::
|
||||
|
||||
For the complete code, please refer to `Examples`: `Example13_LineSimple.cs`
|
||||
|
||||
@@ -229,7 +260,11 @@ The default font used by XCharts is Unity's default font `Arial`, which may not
|
||||
|
||||
After the font is set, newly created charts will use the newly set font. For old charts, you can click the `Rebuild Chart Object` button to refresh.
|
||||
|
||||
>Note: It is recommended to set the font before using XCharts; when updating XCharts, pay attention to the potential restoration of the set font.
|
||||
:::tip
|
||||
|
||||
It is recommended to set the font before using XCharts; when updating XCharts, pay attention to the potential restoration of the set font.
|
||||
|
||||
:::
|
||||
|
||||
### Using TextMeshPro
|
||||
|
||||
@@ -271,7 +306,11 @@ XCharts has an automatic refresh mechanism, but it is also triggered under certa
|
||||
2. `chart.RefreshChart()`: Refresh chart rendering, which only refreshes the rendering part and will not refresh component text, position, etc.
|
||||
3. Each component can also refresh itself by calling `SetAllDirty()`.
|
||||
|
||||
>Note: Use APIs to manipulate data and various lists, not directly access the list for processing.
|
||||
:::tip
|
||||
|
||||
Use APIs to manipulate data and various lists, not directly access the list for processing.
|
||||
|
||||
:::
|
||||
|
||||
### Changing Parameters on Main Components
|
||||
|
||||
@@ -288,7 +327,11 @@ xAxis.boundaryGap = true;
|
||||
xAxis.type = Axis.AxisType.Category;
|
||||
```
|
||||
|
||||
> Note: In older versions without the `EnsureChartComponent()` interface, use `GetOrAddChartComponent()`
|
||||
:::tip
|
||||
|
||||
In older versions without the `EnsureChartComponent()` interface, use `GetOrAddChartComponent()`
|
||||
|
||||
:::
|
||||
|
||||
### Changing Serie Parameters
|
||||
|
||||
|
||||
@@ -2347,7 +2347,7 @@ public void UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0)
|
||||
|
||||
## BaseGraph
|
||||
|
||||
class in XCharts.Runtime / 继承自: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / 子类: [BaseChart](#basechart),[UIComponent](#uicomponent)
|
||||
class in XCharts.Runtime / 继承自: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler), / 子类: [BaseChart](#basechart),[UIComponent](#uicomponent)
|
||||
|
||||
### BaseGraph.chartHideFlags
|
||||
|
||||
@@ -5858,7 +5858,7 @@ class in / 子类: [XLog](#xlog)
|
||||
|
||||
## ObjectPool<T> where T
|
||||
|
||||
class in XCharts.Runtime / 继承自: [new()](#new())
|
||||
class in XCharts.Runtime / 继承自: new()
|
||||
|
||||
### ObjectPool<T> where T.countActive
|
||||
|
||||
|
||||
@@ -5,162 +5,123 @@ slug: /faq
|
||||
|
||||
# 常见问题
|
||||
|
||||
[FAQ 1:如何调整坐标轴与背景的边距?](#如何调整坐标轴与背景的边距)
|
||||
[FAQ 2:如何让初始动画重新播放?](#如何让初始动画重新播放)
|
||||
[FAQ 3:如何自定义折线图饼图的颜色?](#如何自定义折线图饼图的颜色)
|
||||
[FAQ 4:如何给坐标轴上的文本加上单位?](#如何给坐标轴上的文本加上单位)
|
||||
[FAQ 5:如何让柱形图的柱子堆叠显示?](#如何让柱形图的柱子堆叠显示)
|
||||
[FAQ 6:如何让柱形图的柱子同柱但不重叠?](#如何让柱形图的柱子同柱但不重叠)
|
||||
[FAQ 7:如何调整柱形图的柱子宽度和间距?](#如何调整柱形图的柱子宽度和间距)
|
||||
[FAQ 8:如何调整柱形图单个柱子的颜色?](#如何调整柱形图单个柱子的颜色)
|
||||
[FAQ 9:如何调整图表的对齐方式?](#如何调整图表的对齐方式)
|
||||
[FAQ 10:可以显示超过1000以上的大数据吗?](#可以显示超过1000以上的大数据吗)
|
||||
[FAQ 11:折线图可以画虚线、点线、点划线吗?](#折线图可以画虚线点线点划线吗)
|
||||
[FAQ 12:如何限定Y轴的值范围?](#如何限定y轴的值范围)
|
||||
[FAQ 13:如何自定义数值轴刻度大小?](#如何自定义数值轴刻度大小)
|
||||
[FAQ 14:如何在数据项顶上显示文本?](#如何在数据项顶上显示文本)
|
||||
[FAQ 15:如何给数据项自定义图标?](#如何给数据项自定义图标)
|
||||
[FAQ 16:锯齿太严重,如何让图表更顺滑?](#锯齿太严重如何让图表更顺滑)
|
||||
[FAQ 17:为什么鼠标移上图表Tooltip不显示?](#为什么鼠标移上图表tooltip不显示)
|
||||
[FAQ 18:如何取消Tooltip的竖线?](#如何取消tooltip的竖线)
|
||||
[FAQ 19:如何自定义Tooltip的显示内容?](#如何自定义tooltip的显示内容)
|
||||
[FAQ 20:如何让y轴显示多位小数?](#如何让y轴显示多位小数)
|
||||
[FAQ 21:如何用代码动态更新数据?](#如何用代码动态更新数据)
|
||||
[FAQ 22:如何显示图例?为什么有时候图例无法显示?](#如何显示图例为什么有时候图例无法显示)
|
||||
[FAQ 23:如何做成预设?](#如何做成预设)
|
||||
[FAQ 24:如何在图表上画点画线等自定义内容?](#如何在图表上画点画线等自定义内容)
|
||||
[FAQ 25:如何实现心电图类似的数据移动效果?](#如何实现心电图类似的数据移动效果)
|
||||
[FAQ 26:如何使用背景组件?有什么条件限制?](#如何使用背景组件有什么条件限制)
|
||||
[FAQ 27:Mesh can not have more than 65000 vertices?](#mesh_cannot_have_more_than_65000_vertices)
|
||||
[FAQ 28:为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
|
||||
[FAQ 29:如何修改serie的symbol的颜色?](#如何修改serie的symbol的颜色)
|
||||
[FAQ 30:导入或更新XCharts时TMP报错如何处理?](#导入或更新xcharts时tmp报错怎么办)
|
||||
[FAQ 31:支持空数据吗?如何实现折线图断开的效果?](#支持空数据吗如何实现折线图断开的效果)
|
||||
[FAQ 32:2.x版本升级3.x版本时常见的问题有哪些?](#xcharts2升级xcharts3时常见的问题有哪些)
|
||||
[FAQ 33:折线图如何两边不留空白而从0坐标开始显示?](#折线图如何两边不留空白而从0坐标开始显示)
|
||||
[FAQ 34:如何设置部分Serie不显示Tooltip?](#如何设置部分serie不显示tooltip)
|
||||
|
||||
## 如何调整坐标轴与背景的边距
|
||||
## FAQ 1:如何调整坐标轴与背景的边距?
|
||||
|
||||
调整`Grid`组件,可调整上下左右边距。
|
||||
|
||||
## 如何让初始动画重新播放
|
||||
## FAQ 2:如何让初始动画重新播放?
|
||||
|
||||
调用`chart.AnimationReset()`接口。
|
||||
|
||||
## 如何自定义折线图饼图的颜色
|
||||
## FAQ 3:如何自定义折线图饼图的颜色?
|
||||
|
||||
通过`Theme`的`colorPalette`调整,或者部分`Serie`下的`LineStyle`和`ItemStyle`。
|
||||
|
||||
## 如何给坐标轴上的文本加上单位
|
||||
## FAQ 4:如何给坐标轴上的文本加上单位?
|
||||
|
||||
通过`formatter`和`numericFormatter`参数,在`Legend`、`Axis`的`AxisLabel`、`Tooltop`、`Serie`的`Label`都提供该参数的配置。
|
||||
|
||||
## 如何让柱形图的柱子堆叠显示
|
||||
## FAQ 5:如何让柱形图的柱子堆叠显示?
|
||||
|
||||
设置`Serie`下的`stack`,`stack`相同的`serie`会堆叠显示在一个柱子上。
|
||||
|
||||
## 如何让柱形图的柱子同柱但不重叠
|
||||
## FAQ 6:如何让柱形图的柱子同柱但不重叠?
|
||||
|
||||
设置`Serie`下的`barGap`为`-1`,`stack`为空。
|
||||
|
||||
## 如何调整柱形图的柱子宽度和间距
|
||||
## FAQ 7:如何调整柱形图的柱子宽度和间距?
|
||||
|
||||
调整`Serie`下的`barWidth`和`barGap`,多个`serie`时最后一个`serie`的`barWidth`和`barGap`有效。
|
||||
|
||||
## 如何调整柱形图单个柱子的颜色
|
||||
## FAQ 8:如何调整柱形图单个柱子的颜色?
|
||||
|
||||
可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
|
||||
|
||||
## 如何调整图表的对齐方式
|
||||
## FAQ 9:如何调整图表的对齐方式?
|
||||
|
||||
调整RectTransform的锚点,和UGUI的其他组件的用法一致。
|
||||
|
||||
## 可以显示超过1000以上的大数据吗
|
||||
## FAQ 10:可以显示超过1000以上的大数据吗?
|
||||
|
||||
可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie`的`symbol`和`label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large`和`largeThreshold`参数来开启性能模式。
|
||||
|
||||
## 折线图可以画虚线点线点划线吗
|
||||
## FAQ 11:折线图可以画虚线、点线、点划线吗?
|
||||
|
||||
可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。
|
||||
|
||||
## 如何限定y轴的值范围
|
||||
## FAQ 12:如何限定Y轴的值范围?
|
||||
|
||||
设置`Axis`下的`minMaxType`为`Custom`,自定义`min`和`max`。
|
||||
|
||||
## 如何自定义数值轴刻度大小
|
||||
## FAQ 13:如何自定义数值轴刻度大小?
|
||||
|
||||
默认时通过`Axis`下的`splitNumer`进行自动划分。也可以设置`interval`自定义刻度大小。
|
||||
|
||||
## 如何在数据项顶上显示文本
|
||||
## FAQ 14:如何在数据项顶上显示文本?
|
||||
|
||||
通过设置`Serie`下的`Label`。3.0版本需要先添加`LabelStyle`组件。
|
||||
|
||||
## 如何给数据项自定义图标
|
||||
## FAQ 15:如何给数据项自定义图标?
|
||||
|
||||
通过设置`Serie`的`data`下的数据项可单独设置`icon`相关参数。
|
||||
|
||||
## 锯齿太严重如何让图表更顺滑
|
||||
## FAQ 16:锯齿太严重,如何让图表更顺滑?
|
||||
|
||||
开启抗锯齿设置(在`Unity`里设置)。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。
|
||||
|
||||
## 为什么鼠标移上图表tooltip不显示
|
||||
## FAQ 17:为什么鼠标移上图表Tooltip不显示?
|
||||
|
||||
确认`Tooltip`是否开启;确认父节点是否关闭了鼠标事件。
|
||||
|
||||
## 如何取消tooltip的竖线
|
||||
## FAQ 18:如何取消Tooltip的竖线?
|
||||
|
||||
设置`Tooltip`的`type`为`None`。或者调整`lineStyle`的参数。
|
||||
|
||||
## 如何自定义tooltip的显示内容
|
||||
## FAQ 19:如何自定义Tooltip的显示内容?
|
||||
|
||||
自定义总的内容可以通过`Tooltip`的`formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter`和`titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie`的`itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](https://xcharts-team.github.io/docs/configuration#Tooltip-itemFormatter)。
|
||||
|
||||
## 如何让y轴显示多位小数
|
||||
## FAQ 20:如何让y轴显示多位小数?
|
||||
|
||||
设置`Axis`下的`AxisLabel`中的`formatter`为`{value:f1}`或`{value:f2}`。`1.5.0`及以上版本通过`numericFormatter`设置。
|
||||
|
||||
## 如何用代码动态更新数据
|
||||
## FAQ 21:如何用代码动态更新数据?
|
||||
|
||||
请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能,相关API请查看文档:[XChartsAPI接口](api.md) 。
|
||||
|
||||
## 如何显示图例为什么有时候图例无法显示
|
||||
## FAQ 22:如何显示图例?为什么有时候图例无法显示?
|
||||
|
||||
首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例的`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示。
|
||||
|
||||
## 如何做成预设
|
||||
## FAQ 23:如何做成预设?
|
||||
|
||||
做成prefab前,执行一下`Rebuild Chart Object`重新刷新节点,避免有冗余的节点存在。
|
||||
|
||||
## 如何在图表上画点画线等自定义内容
|
||||
## FAQ 24:如何在图表上画点画线等自定义内容?
|
||||
|
||||
`XCharts`有自定义绘制回调`onCustomDraw`,具体可参考`Example12_CustomDrawing.cs`
|
||||
|
||||
## 如何实现心电图类似的数据移动效果
|
||||
## FAQ 25:如何实现心电图类似的数据移动效果?
|
||||
|
||||
参考`Example`目录下的`Example_Dynamic.cs`。主要通过设置`maxCache`参数实现。`axis`和`serie`都设置相同的`maxCache`。`maxCache`可固定数据个数,当数据超过设定时会先删除第一个在添加新数据,实现数据移动效果。
|
||||
|
||||
## 如何使用背景组件有什么条件限制
|
||||
## FAQ 26:如何使用背景组件?有什么条件限制?
|
||||
|
||||
设置`background`组件的`show`为`true`。
|
||||
|
||||
## 区域折线图在用半透明颜色时有时候会一条叠加的线
|
||||
|
||||
这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。
|
||||
|
||||
## mesh_cannot_have_more_than_65000_vertices
|
||||
## FAQ 27:Mesh can not have more than 65000 vertices?
|
||||
|
||||
这是`UGUI`对单个`Graphic`的顶点数限制。`XCharts`是将图形绘制在单个`Graphic`上,所以也会有这个限制。解决的办法可以参考:[FAQ 10:可以显示超过1000以上的大数据吗?](#可以显示超过1000以上的大数据吗)
|
||||
|
||||
## 为什么serie里设置的参数运行后又被重置了
|
||||
## FAQ 28:为什么serie里设置的参数运行后又被重置了?
|
||||
|
||||
检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
|
||||
|
||||
## 如何修改serie的symbol的颜色
|
||||
## FAQ 29:如何修改serie的symbol的颜色?
|
||||
|
||||
`Symbol` 的颜色是使用的 `ItemStyle` 的 `color`。
|
||||
|
||||
## 导入或更新xcharts时tmp报错怎么办
|
||||
## FAQ 30:导入或更新XCharts时TMP报错如何处理?
|
||||
|
||||
XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决:
|
||||
|
||||
@@ -169,19 +130,23 @@ XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开
|
||||
|
||||
`3.8.0`版本后增加[XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)守护程序,将XCharts-Daemon导入项目后,在更新XCharts时守护程序会自动根据本地开启的TMP情况刷新asmdef,确保编译正常。
|
||||
|
||||
## 支持空数据吗如何实现折线图断开的效果
|
||||
## FAQ 31:支持空数据吗?如何实现折线图断开的效果?
|
||||
|
||||
`Serie`的`data`是`double`类型,所以无法表示空数据。可通过开启`Serie`的`ignore`和指定`ignoreValue`来达到空数据的效果。也可以每个`SerieData`设置`ignore`参数。忽略数据后断开还是连接可设置`ignoreLineBreak`参数。
|
||||
|
||||
## xcharts2升级xcharts3时常见的问题有哪些
|
||||
## FAQ 32:2.x版本升级3.x版本时常见的问题有哪些?
|
||||
|
||||
1. 'XCharts.Runtime.XChartsMgr' is missing the class attribute 'ExtensionOfNativeClass'!
|
||||
3.x版本时不需要挂载XChartsMgr,直接删掉场景上的`_xcharts_`节点即可。
|
||||
|
||||
## 折线图如何两边不留空白而从0坐标开始显示
|
||||
## FAQ 33:折线图如何两边不留空白而从0坐标开始显示?
|
||||
|
||||
设置X轴的`boundaryGap`参数。
|
||||
|
||||
## 如何设置部分serie不显示tooltip
|
||||
## FAQ 34:如何设置部分Serie不显示Tooltip?
|
||||
|
||||
`serie`的`itemStyle`的`itemFormatter`设置为`-`可以忽略`tooltip`。
|
||||
|
||||
## FAQ 35:区域折线图在用半透明颜色时有时候会一条叠加的线
|
||||
|
||||
这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。
|
||||
|
||||
@@ -6,7 +6,11 @@ slug: /tutorial01
|
||||
|
||||
# 教程:5分钟上手 XCharts 3.0
|
||||
|
||||
> Note:本教程仅适用XCharts 3.x版本,2.x版本请看 [教程:5分钟上手XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/教程:5分钟上手XCharts.md)
|
||||
:::warning
|
||||
|
||||
Note:本教程仅适用XCharts 3.x版本,2.x版本请看 [教程:5分钟上手XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/教程:5分钟上手XCharts.md)
|
||||
|
||||
:::
|
||||
|
||||
## XCharts的前提条件
|
||||
|
||||
@@ -54,7 +58,11 @@ XCharts-Daemon的导入方式可参考刚才的XCharts导入方式。可以通
|
||||
|
||||
导入XCharts并编译通过后,Unity编辑器的菜单栏会显示XCharts,这时可以开始使用XCharts了。
|
||||
|
||||
>Note:Unity的菜单栏出现XCharts菜单时才表示XCharts可用。
|
||||
:::tip
|
||||
|
||||
Unity的菜单栏出现XCharts菜单时才表示XCharts可用。
|
||||
|
||||
:::
|
||||
|
||||
### 添加一个简单图表
|
||||
|
||||
@@ -85,7 +93,11 @@ Serie支持多维数据,一般折线图只用到二维数据:第一维表示
|
||||

|
||||

|
||||
|
||||
>Note:Serie通过`Add Serie`按钮添加。可添加不同类型的Serie。[XCharts有哪些Serie?](https://xcharts-team.github.io/docs/configuration#serie-系列)
|
||||
:::tip
|
||||
|
||||
Serie通过`Add Serie`按钮添加。可添加不同类型的Serie。[XCharts有哪些Serie?](https://xcharts-team.github.io/docs/configuration#serie-系列)
|
||||
|
||||
:::
|
||||
|
||||
### 添加其他主组件
|
||||
|
||||
@@ -93,7 +105,11 @@ Serie支持多维数据,一般折线图只用到二维数据:第一维表示
|
||||
|
||||

|
||||
|
||||
>Note:主组件通过`Add Component`按钮添加。[XCharts有哪些主组件?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件)
|
||||
:::tip
|
||||
|
||||
主组件通过`Add Component`按钮添加。[XCharts有哪些主组件?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件)
|
||||
|
||||
:::
|
||||
|
||||
### 添加Serie组件
|
||||
|
||||
@@ -102,7 +118,11 @@ Serie只自带了几个常见的组件,其他组件用到时需额外添加。
|
||||

|
||||

|
||||
|
||||
>Note:Serie组件通过Serie右边的按钮添加。[XCharts有哪些Serie组件?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件)
|
||||
:::tip
|
||||
|
||||
Serie组件通过Serie右边的按钮添加。[XCharts有哪些Serie组件?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件)
|
||||
|
||||
:::
|
||||
|
||||
### 添加SerieData组件
|
||||
|
||||
@@ -111,7 +131,11 @@ Serie只自带了几个常见的组件,其他组件用到时需额外添加。
|
||||

|
||||

|
||||
|
||||
>Note:SerieData组件通过展开SerieData后Component右边的按钮添加。[XCharts有哪些SerieData组件?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件)
|
||||
:::tip
|
||||
|
||||
SerieData组件通过展开SerieData后Component右边的按钮添加。[XCharts有哪些SerieData组件?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件)
|
||||
|
||||
:::
|
||||
|
||||
### 更多组件和配置参数
|
||||
|
||||
@@ -131,7 +155,11 @@ XCharts是数据和参数驱动的。想要什么效果,只需要去调整对
|
||||
2. 如果`Serie`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
|
||||
3. 否则颜色值取自主题`Theme`的`Color Palette`。
|
||||
|
||||
>Note:通常颜色值为0000时表示用主题默认颜色;其他参数为0或null时表示用主题默认配置;设置颜色时注意透明度。
|
||||
:::tip
|
||||
|
||||
通常颜色值为0000时表示用主题默认颜色;其他参数为0或null时表示用主题默认配置;设置颜色时注意透明度。
|
||||
|
||||
:::
|
||||
|
||||
### 用代码添加折线图
|
||||
|
||||
@@ -212,7 +240,11 @@ for (int i = 0; i < 10; i++)
|
||||
|
||||
如果一个Chart里面有多个系列时,则Axis的data只需要加一次,不要多个循环加重复了。
|
||||
|
||||
>记住:Axis的数据个数要和Serie的数据个数一致。
|
||||
:::danger
|
||||
|
||||
请确保Axis的数据个数和Serie的数据个数一致。
|
||||
|
||||
:::
|
||||
|
||||
完整代码请查阅`Examples`:`Example13_LineSimple.cs`
|
||||
|
||||
@@ -227,7 +259,11 @@ XCharts默认使用的是Unity默认字体`Arial`,在WebGL平台上可能无
|
||||
|
||||
字体设置好后,新创建的图表就会用新设置的字体了。对于旧图表,可以点击`Rebuild Chart Object`进行刷新。
|
||||
|
||||
>Note:使用XCharts前建议先设置好字体;更新XCharts时注意设置的字体可能被还原的问题。
|
||||
:::warning
|
||||
|
||||
使用XCharts前建议先设置好字体;更新XCharts时注意设置的字体可能被还原的问题。
|
||||
|
||||
:::
|
||||
|
||||
### 使用TextMeshPro
|
||||
|
||||
@@ -269,7 +305,11 @@ XCharts内部有自动刷新机制,但也是在一定条件才会触发。如
|
||||
2. `chart.RefreshChart()`:刷新图表绘制,只刷新绘制部分,不会刷新组件文本,位置等部分。
|
||||
3. 各个组件也可以通过`SetAllDirty()`只刷新自己。
|
||||
|
||||
>Note:用API去操作数据和各种list,而不是直接访问list进行处理
|
||||
:::danger
|
||||
|
||||
用API去操作数据和各种list,而不是直接访问list进行处理
|
||||
|
||||
:::
|
||||
|
||||
### 改主组件上的参数
|
||||
|
||||
@@ -286,7 +326,11 @@ xAxis.boundaryGap = true;
|
||||
xAxis.type = Axis.AxisType.Category;
|
||||
```
|
||||
|
||||
> 注:低版本没有`EnsureChartComponent()`接口时,用`GetOrAddChartComponent()`
|
||||
:::note
|
||||
|
||||
低版本没有`EnsureChartComponent()`接口时,用`GetOrAddChartComponent()`
|
||||
|
||||
:::
|
||||
|
||||
### 改Serie的参数
|
||||
|
||||
|
||||
11
README-en.md
11
README-en.md
@@ -1,14 +1,7 @@
|
||||
<p align="center">
|
||||
<a href="">
|
||||
<img src="" alt="" width="" height=""></img>
|
||||
</a>
|
||||
</p>
|
||||
<h2 align="center">XCharts</h2>
|
||||
<p align="center">
|
||||
<h2 align="center">XCharts</h2>
|
||||
A powerful, easy-to-use, configurable charting and data visualization library for Unity.
|
||||
<br/>
|
||||
Unity数据可视化图表插件。
|
||||
<br/>
|
||||
<br/>Unity数据可视化图表插件。<br/>
|
||||
<a href="https://github.com/XCharts-Team/XCharts">中文文档</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
|
||||
14
README.md
14
README.md
@@ -1,14 +1,8 @@
|
||||
|
||||
|
||||
<p align="center">
|
||||
<a href="">
|
||||
<img src="" alt="" width="" height=""></img>
|
||||
</a>
|
||||
</p>
|
||||
<h2 align="center">XCharts</h2>
|
||||
<p align="center">
|
||||
A powerful, easy-to-use, configurable charting and data visualization library for Unity.
|
||||
<br/>
|
||||
Unity数据可视化图表插件。
|
||||
<br/>
|
||||
<h2 align="center">XCharts</h2>
|
||||
A powerful, easy-to-use, configurable charting and data visualization library for Unity.<br/>Unity数据可视化图表插件。<br/>
|
||||
<a href="README-en.md">English README</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
|
||||
Reference in New Issue
Block a user