This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
unity-ugui-xcharts with all
npm packages installed. Try it out:
unity-ugui-xcharts lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
A powerful, easy-to-use, configurable charting and data visualization library for Unity. Supporting line, bar, pie, radar, scatter, heatmap, gauge, ring, polar, liquid and other common chart.
XCharts consist of components and data. Different components and data can be combined into different types of charts. The component is divided into main component and sub component. The main component contains the sub components.
XCharts main components:
Themetheme component, which can configure the default colors, fonts and so on.
Titletitle component, which contains the main title and subtitle.
Legendlegend component, which represent different sets of symbols, colors, and names. You can control which series are not displayed by clicking on the legend.
Gridgrid component, drawing grid in rectangular coordinate system. Up to two X axes and two Y axes can be placed within a grid component. You can draw line, bar and scatter chart on the grid.
Axisaxis component, the axis of a rectangular coordinate system. Supports the upper and lower X axes and the left and right Y axes.
Seriesseries component, a list of serie. A chart can contain many different series, and each series determines its own chart type by type.
Tooltiptooltip component, feedback more details of the data indicated by the mouse at the time.
DataZoomdata zoom component, used for area zooming so you can focus on detailed data information, or overview the data as a whole, or remove the impact of outliers.
VisualMapvisual mapping component, you can map data in different colors.
Radarradar component, suitable for radar chart only.
Settingsglobal Settings component, Some global parameters can be adjusted. Use the default values in general and adjust them as needed.
XCharts support chart:
The following is the relationship structure of LineChart:
. ├── LineChart . ├── ThemeInfo ├── Title │ └── Location ├── Legend │ └── Location ├── Tooltip ├── DataZoom ├── VisualMap ├── Grid ├── Axis │ ├── AxisLine │ ├── AxisName │ ├── AxisLabel │ ├── AxisTick │ └── AxisSplitArea ├── Series │ ├── ItemStyle │ ├── AreaStyle │ ├── SerieSymbol │ ├── LineStyle │ ├── LineArrow │ ├── SerieLabel │ ├── Emphasis │ ├── Animation │ └── SerieData └── Settings
This project was developed under
Unity 2017.4.27f1 and
.net 3.5, tested normally on
Unity 2018 and
Unity 2019. It can theoretically run on any version that supports
Download the source code or
unitypackage to import into your project. If
Unity version are
2018.3 or above, it is recommended to import packages through
Packagesdirectory and add under
Unity, it may take 3 to 5 minutes to download.
XCharts, just delete the content added in step 1.
manifest.jsonfile , delete the content about
lock, it will download anagain. Also can check For update in
components-> XCharts -> Check For Update.
Add a chart in Editor quickly:
Hierarchy, right-click menu
Inspectoryou can adjust the parameters of components, and in
Gamewill feedback the adjustment effect in realtime 。the detail of parameters go to see: XCharts Configuration.
See more examples of code dynamic control: Tutorial - Get start with XCharts in 5 minute.