ChartData2D
Definition
A ChartData2D component represents a single two-dimensional Data Series in the Chart component, for example, a single Line in the case of a Line Chart, or a single Bar in the case of a Bar Chart. The Data component is responsible for handling all the data of the Chart. The entries of the Data component correspond of an x and a y value. The component is attached directly to a Chart component by dragging it onto the Chart.
Properties
- Color
- Specifies the data series color as an alpha-red-green-blue integer.
- Colors
- Specifies the data series colors as a list of alpha-red-green-blue integers.If there is more data than there are colors, the colors will be alternated in order. E.g. if there are two colors Red and Blue, the colors will be applied in the order: Red, Blue, Red, Blue, …
- DataFileXColumn
- Value used when importing data from a DataFile component
Source
. The value represents the column to use from the DataFile for the x entries of the Data Series. For instance, if a column’s first value is “Time”, and a column value of “Time” is specified, that column will be used for the x values. If a value here is not specified, default values for the x values will be generated instead. - DataFileYColumn
- Value used when importing data from a DataFile component
Source
. The value represents the column to use from the DataFile for the y entries of the Data Series. For instance, if a column’s first value is “Temperature”, and a column value of “Temperature” is specified, that column will be used for the y values. If a value here is not specified, default values for the y values will be generated instead. - DataSourceKey
- Sets the Data Source key identifier for the value to import from the attached Data Source.An example is the tag of the TinyDB component, which identifies the value.
The property is a Designer-only property, and should be changed after setting the Source component of the Chart Data component.
A complete list of applicable values for each compatible source is as follows:
- For TinyDB and CloudDB, this is the tag value.
- For the AccelerometerSensor, the value should be one of the following: X Y or Z
- For the GyroscopeSensor, the value should be one of the following: X Y or Z
- For the LocationSensor, the value should be one of the following: latitude, longitude, altitude or speed
- For the OrientationSensor, the value should be one of the following: pitch, azimuth or roll
- For the Pedometer, the value should be one of the following: WalkSteps, SimpleSteps or Distance
- For the ProximitySensor, the value should be distance.
- For the BluetoothClient, the value represents the prefix to remove from the value. For instance, if values come in the format “t:12”, the prefix can be specified as “t:”, and the prefix will then be removed from the data. No value can be specified if purely numerical values are returned.
- ElementsFromPairs
- Comma separated list of Elements to use for the data series. Values are formatted as follows: x1,y1,x2,y2,x3,y3. Values are taken in pairs, and an entry is formed from the x and y values.
- Label
- Specifies the text for the data series label.
- LineType
- Changes the Line Type of the Data Series, provided that the Data component is attached to a Chart that has the type set to a line-based Chart(applies to area and line Chart types). Valid types include linear, curved or stepped.
- PointShape
- Changes the Point Shape of the Data Series, provided that the Data component is attached to a Chart that has the type set to the Scatter Chart. Valid types include circle, square, triangle, cross, x.
- Source
- Sets the Source to use for the Data component. Valid choices include AccelerometerSensor, BluetoothClient, CloudDB, DataFile, GyroscopeSensor, LocationSesnro, OrientationSensor, Pedometer, ProximitySensor TinyDB and Web components. The Source value also requires valid DataSourceValue, WebColumn or DataFileColumn properties, depending on the type of the Source attached (the required properties show up in the Properties menu after the Source is changed).If the data identified by the
DataSourceKey
is updated in the attached Data Source component, then the data is also updated in the Chart Data component. - SpreadsheetUseHeaders
- If checked, the first row of the spreadsheet will be used to interpret the x and y column values. Otherwise, the x and y columns should be a column reference, such as A or B.
- SpreadsheetXColumn
- Sets the column to parse from the attached Spreadsheet component for the x values. If a column is not specified, default values for the x values will be generated instead.
- SpreadsheetYColumn
- Sets the column to parse from the attached Spreadsheet component for the y values. If a column is not specified, default values for the y values will be generated instead.
- WebXColumn
- Value used when importing data from a Web component Source. The value represents the column to use from the Web for the x entries of the Data Series. For instance, if the contents of the Web are retrieved in JSON format, and an array with the “Time” tag exists, the “Time” column value can be specified to use that array.
- WebYColumn
- Value used when importing data from a Web component Source. The value represents the column to use from the Web for the y entries of the Data Series. For instance, if the contents of the Web are retrieved in JSON format, and an array with the “Temperature” tag exists, the “Temperature” column value can be specified to use that array.