Skip to content

Commit b998248

Browse files
authored
Merge pull request MicrosoftDocs#3192 from MicrosoftDocs/Nava_charts
Presentation XML updates for charts
2 parents 075ddad + 442a7ed commit b998248

File tree

1 file changed

+217
-21
lines changed

1 file changed

+217
-21
lines changed

powerapps-docs/developer/model-driven-apps/understand-charts-underlying-data-chart-representation.md

Lines changed: 217 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ Charts display data visually by mapping textual values on two axes: horizontal (
4040
> Microsoft Chart Controls lets you create various types of charts such as column, bar, area, line, pie, funnel, bubble, and radar. The chart designer in model-driven apps lets you create only certain types of charts. However, using the SDK, you can create most of the chart types that are supported by Microsoft Chart Controls.
4141
4242
## Use the data description XML string to specify chart data
43-
The data description XML string defines the data that will displayed on the chart. The contents of the XML string are validated against the visualization data description schema. For more information about the schema, see [Visualization Data Description Schema](visualization-data-description-schema.md).
43+
44+
The data description XML string defines the data that is displayed on the chart. The contents of the XML string are validated against the visualization data description schema. For more information about the schema, see [Visualization Data Description Schema](visualization-data-description-schema.md).
4445

45-
You can specify the data description XML string while you are creating a chart using the `SavedQueryVisualization.DataDescription` or the `UserQueryVisualization.DataDescription` attribute for the organization-owned or user-owned chart respectively.
46+
You can specify the data description XML string while you are creating a chart using the `SavedQueryVisualization.DataDescription` or `UserQueryVisualization.DataDescription` attribute for the organization-owned or user-owned chart respectively.
4647

4748
The data description XML string contains the following two elements: `<FetchCollection>` and `<CategoryCollection>`.
4849

@@ -55,9 +56,10 @@ Charts display data visually by mapping textual values on two axes: horizontal (
5556
> [!NOTE]
5657
> Although the data description XML string is validated again the visualization data description schema, the FetchXML query inside the `<FetchCollection>` element is not. The FetchXML query is validated against the FetchXML schema. For more information, see [FetchXML schema](../common-data-service/fetchxml-schema.md).
5758
58-
If the chart is a comparison chart, the `<FetchCollection>` element will contain two *group by* clauses.
59+
If the chart is a comparison chart, the `<FetchCollection>` element will contain two groups by* clauses.
5960

6061
### The \<CategoryCollection> element
62+
6163
The `<CategoryCollection>` element contains information about the category (horizontal) and the series (vertical) axes in a chart.
6264

6365
- Each `<Category>` sub-element has a child element called `<MeasureCollection>` that maps to the `<Series>` element in the presentation description XML. A single series chart has a single `<MeasureCollection>` child element whereas a multi-series chart will have multiple `<MeasureCollection>` child elements, each mapped to the respective `<Series>` element in the presentation description XML.
@@ -86,15 +88,20 @@ Charts display data visually by mapping textual values on two axes: horizontal (
8688
</categorycollection></datadefinition>
8789
```
8890

89-
For more sample data description XML strings, see [Sample Charts](sample-charts.md).
90-
91-
## Use the presentation description XML string to specify data representation
92-
The presentation description XML string contains information about the appearance of the chart such as chart title, chart color, and chart type (bar, column, line, and so on). There is no schema definition for this XML string. However, the XML is a serialization of the [Chart](https://msdn.microsoft.com/library/system.web.ui.datavisualization.charting.chart.aspx) class in Microsoft Chart Controls. More information: [Chart Controls](https://go.microsoft.com/fwlink/p/?LinkId=128301)
93-
94-
You can specify the presentation description XML string while you are creating a chart using the `SavedQueryVisualization.PresentationDescription` or `UserQueryVisualization.PresentationDescription` attribute for the organization-owned or user-owned chart, respectively.
91+
For more sample data description XML strings, see [Sample Charts](sample-charts.md).
9592

96-
### Example
97-
The following is a sample presentation description XML string:
93+
## Use the presentation description XML string to specify data representation
94+
95+
The presentation description XML string contains information about the appearance of the chart such as chart title, chart color, and chart type (bar, column, line, and so on). There is no schema definition for this XML string. However, the XML is a serialization of the [Chart](https://msdn.microsoft.com/library/system.web.ui.datavisualization.charting.chart.aspx) class in Microsoft Chart Controls. More information: [Chart Controls](https://go.microsoft.com/fwlink/p/?LinkId=128301)
96+
97+
You can specify the presentation description XML string while you are creating a chart using the `SavedQueryVisualization.PresentationDescription` or `UserQueryVisualization.PresentationDescription` attribute for the organization-owned or user-owned chart, respectively.
98+
99+
> [!IMPORTANT]
100+
> In Unified Interface, only a subset of properties are supported. More information: [Supported methods and properties in Unified Interface](#methods-and-properties-supported-in-unified-interface)
101+
102+
### Example for web client
103+
104+
The following is a sample presentation description XML string for web client:
98105

99106
```xml
100107
<Chart Palette="BrightPastel">
@@ -122,14 +129,203 @@ Charts display data visually by mapping textual values on two axes: horizontal (
122129
</Chart>
123130
```
124131

125-
For more sample presentation description XML strings, see [Sample Charts](sample-charts.md).
126-
132+
For more sample presentation description XML strings, see [Sample Charts](sample-charts.md).
133+
134+
## Methods and properties supported in Unified Interface
135+
136+
The following section shows the methods and properties that are supported in Unified Interface:
137+
138+
### AxisX
139+
140+
Gets or sets the X-axis type of the series.
141+
142+
**Properties**
143+
144+
|Property Name| Description|
145+
|-------------|------------|
146+
|Enabled|Gets or sets a value that indicates whether an axis is enabled.|
147+
|LabelStyle Enabled|Gets or sets a flag that indicates whether the label is enabled.|
148+
|LabelStyle ForeColor|Gets or sets the color of the label.|
149+
|LabelStyle Format|Gets or sets the formatting string for the label text. More information: [Supported numeric format for charts](#supported-numeric-format-for-charts-in-unified-interface)|
150+
|LineColor|Gets or sets the line color of an axis. More information: [Supported color format](#supported-color-format-in-unified-interface)|
151+
|IsReversed|Gets or sets a flag which indicates whether the axis is reversed.<br/> If set to true, it has two effects for x-axis:<br/> - x-axis labels are flipped in the reversed order (from right-to-left)<br/>- It also bring the y-axis to the opposite side, to accommodate above right-to-left x-axis label.|
152+
|MajorGrid Enabled|Gets or sets a flag that determines whether major or minor grid lines are enabled.|
153+
|MajorGrid LineColor|Gets or sets the line color of a grid. More information: [Supported color format](#supported-color-format-in-unified-interface)|
154+
|MajorTickMark Enabled|Gets or sets a flag that determines whether major grid lines are enabled.|
155+
|MajorTickMark LineColor|Gets or sets the line color of a grid.|
156+
|Title|Gets or sets the title of the axis.|
157+
|TitleForeColor|Gets or sets the text color of an axis title. More information: [Supported color format](#supported-color-format-in-unified-interface)|
158+
159+
**Example**
160+
161+
```xml
162+
<AxisX Enabled="True" LineColor="165, 172, 181" Title="Test XAxis Title" TitleForeColor="91,151,213" IsReversed="true">
163+
<MajorTickMark LineColor="165, 172, 181" Enabled="true" />
164+
<MajorGrid LineColor="green" Enabled="true"/>
165+
<LabelStyle ForeColor="red" Format="#,0,.##K" Enabled="true" />
166+
</AxisX>
167+
```
168+
169+
### AxisY
170+
171+
Gets or sets the Y-axis type of the series.
172+
173+
**Properties**
174+
175+
|Property Name| Description|
176+
|-------------|------------|
177+
|AxisY2|Gets or sets an Axis object that represents the secondary Y-axis.<br/> - Second Yaxis only applies to multiple series chart. <br/> - If you create multiple series chart with the chart editor, by default, the `YAxisType=Secondary` property will be added to the 2nd series of your chart, and a `AxisY2` node is added to the XML.<br/> - If you want another series to be measured by second Y axis, you can move the `YAxisType=Secondary` to that series node. <br/> - If you don't want a second Y axis, you can delete the `YAxisType=Secondary`.<br/> - If a Y Axis (either primary or secondary) measures more than 1 series, title will not be added to that Y Axis, because Y Axis title doesn't know which series to display.|
178+
|Enabled|Gets or sets a value that indicates whether an axis is enabled.|
179+
|Interval|Gets or sets the interval of an axis.|
180+
|LabelStyle Enabled|Gets or sets a flag that indicates whether the label is enabled.|
181+
|LabelStyle ForeColor|Gets or sets the color of the label.|
182+
|LabelStyle Format|Gets or sets the formatting string for the label text. More information: [Supported numeric format for charts](#supported-numeric-format-for-charts-in-unified-interface)|
183+
|LineColor|Gets or sets the line color of an axis. More information: [Supported color format](#supported-color-format-in-unified-interface)|
184+
|MajorGrid Enabled|Gets or sets a flag that determines whether major grid lines are enabled.|
185+
|MajorGrid LineColor|Gets or sets the line color of a grid. More information: [Supported color format](#supported-color-format-in-unified-interface)|
186+
|MajorTickMark Enabled|Gets or sets a flag that determines whether major grid lines are enabled.|
187+
|MajorTickMark LineColor|Gets or sets the line color of a grid.|
188+
|Maximum|Gets or sets the maximum value of an axis.|
189+
|Minimum|Gets or sets the minimum value of an axis.|
190+
|Title|Gets or sets the title of the axis.|
191+
|TitleForeColor|Gets or sets the text color of an axis title. More information: [Supported color format](#supported-color-format-in-unified-interface)|
192+
193+
**Example**
194+
195+
```xml
196+
<AxisY Enabled="True" LineColor="165, 172, 181" Title="Test YAxis Title" TitleForeColor="91,151,213" Interval="1" Minimum="0" Maximum="5">
197+
<MajorTickMark LineColor="165, 172, 181" Enabled="true" />
198+
<MajorGrid LineColor="green" Enabled="true"/>
199+
<LabelStyle ForeColor="red" Enabled="true" />
200+
</AxisY>
201+
<AxisY2 Enabled="True" LineColor="165, 172, 181" Title="Test YAxis2 Title" TitleForeColor="91,151,213" Interval="10" Minimum="0" Maximum="100">
202+
<MajorTickMark LineColor="165, 172, 181" Enabled="true" />
203+
<MajorGrid LineColor="green" Enabled="true"/>
204+
<LabelStyle ForeColor="red" Enabled="true" />
205+
</AxisY2>
206+
```
207+
208+
### Chart
209+
210+
The root class for the charts.
211+
212+
**Properties**
213+
214+
|Property Name|Description|
215+
|-------------|------------|
216+
|PaletteCustomColor|Gets or sets an array of custom palette colors. It follows the priority as shown below: <br/> - Renders the color defined in the `Series` node. <br/> - If the color pallet is specified, chart picks the color from the color pallet. <br/> - If none is specified, it picks up the default color pallet. More information: [Supported color format](#supported-color-format-in-unified-interface)|
217+
218+
**Example**
219+
220+
```xml
221+
<Chart Palette="None" PaletteCustomColors="91, 151, 213; #4169E1, red, 127,97,142,206">
222+
```
223+
224+
### ChartArea
225+
226+
Represents a chart area on the chart image.
227+
228+
**Properties**
229+
230+
|Property Name| Description|
231+
|-------------|------------|
232+
|Area3DStyle Enable3D|Gets or sets a value that indicates whether the flag toggles the 3D on and off for a chart area.|
233+
|BackColor|Allow users to set the plot background to either a solid or a gradient color. More information: [Supported color format](#supported-color-format-in-unified-interface)|
234+
|BackSecondaryColor|Allow users to set the plot background to either a solid or a gradient color. More information: [Supported color format](#supported-color-format-in-unified-interface)|
235+
|BackGradientStyle|Allow users to set the plot background to either a solid or a gradient color.|
236+
237+
**Example**
238+
239+
```xml
240+
<ChartArea BackColor="orange" BackSecondaryColor="purple" BackGradientStyle="LeftRight" >
241+
<Area3DStyle Enable3D="true" />
242+
</ChartArea>
243+
```
244+
245+
### Legend
246+
247+
Represents the legend for the chart image.
248+
249+
**Properties**
250+
251+
|Property Name| Description|
252+
|-------------|------------|
253+
|Enabled| Defines whether the legend is enabled. By default it is set to `True`.|
254+
255+
**Example**
256+
257+
```xml
258+
<Legends>
259+
<Legend Enabled="True"/>
260+
</Legends>
261+
```
262+
263+
### Series
264+
265+
Stores data points and series attributes.
266+
267+
**Properties**
268+
269+
|Property Name| Description|
270+
|-------------|------------|
271+
|BorderColor|Gets or sets the border color of the data point. More information: [Supported color format](#supported-color-format-in-unified-interface)|
272+
|BorderWidth|Gets or sets the border width of the data point.|
273+
|ChartType| An enumeration value that indicates the chart type that is used to represent the series. The default value is Column. It supports the following chart types: <br/> - Column <br/> - StackedColumn <br/> - StackedColumn100 <br/> - Bar <br/> - StackedBar <br/> - StackedBar100 <br/> - Area <br/> - StackedArea <br/> - StackedArea100 <br/> - Line <br/> - Pie <br/> - Funnel <br/> - Tag <br/> - Doughnut <br/> - Point|
274+
|Color|Gets or sets the color of the data point. For funnel and pie charts, the color property defined in the series node is ignored, but picks the chart color from color palette. More information: [Supported color format](#supported-color-format-in-unified-interface)|
275+
|IsValueShownAsLabel|Gets or sets a flag that indicates whether to show the value of the data point on the label.|
276+
|CustomProperties|Allows users to set `FunnelNeckHeight` and `FunnelNeckWidth` to customize funnel chart's shape. FunnelNeckHeight & FunnelNeckWidth represents the percentage. This parameter is only supported for funnel chart types.|
277+
|IsVisibleInLegend|Gets or sets a flag that indicates whether the item is shown in the legend.|
278+
|LabelForeColor|Gets or sets the text color of the label. More information: [Supported color format](#supported-color-format-in-unified-interface)|
279+
|LabelFormat|Gets or sets the format of the data point label. More information: [Supported numeric format for charts](#supported-numeric-format-for-charts-in-unified-interface)|
280+
|LegendText|Gets or sets the text of the item in the legend. For funnel and pie charts, the legend displays each data point's value in a series. Instead of displaying the series name as a whole.|
281+
|YAxisType|Gets or sets the Y-axis type of a series. Only the second Y-axis is supported, not second X-axis.|
282+
283+
**Example**
284+
285+
```xml
286+
<Series>
287+
<Series ChartType="Column" Color="91, 151, 213" LegendText="Est Revenue" IsVisibleInLegend="True" BorderColor="red" BorderWidth="1" IsValueShownAsLabel="True" LabelFormat="$#,0,.##K" LabelForeColor="59, 59, 59">
288+
</Series>
289+
<Series ChartType="Column" Color="237, 125, 49" LegendText="Actual Revenue" IsVisibleInLegend="True" BorderColor="red" BorderWidth="1" IsValueShownAsLabel="True" LabelFormat="$#,0,.##K" LabelForeColor="59, 59, 59" YAxisType="Secondary">
290+
</Series>
291+
</Series>
292+
```
293+
294+
### Supported color format in Unified Interface
295+
296+
Unified Interface supports the following color formats in chart presentation xml, which is compatible with web client:
297+
298+
- RGB Decimal format: 97,142,206
299+
- RGB HEX format: #4169E1
300+
- ARGB Decimal format: 127,90,138,57
301+
- Browser recognized named colors: red, transparent
302+
303+
### Supported numeric format for charts in Unified Interface
304+
305+
|Formatting values|Description|
306+
|------------|----------------|
307+
|`#,0` | No scaling, No decimals, leading zero|
308+
|`#,0,.##K`|Thousands, up to 2 decimals, leading zero|
309+
|`#,0,,.##M`|Millions, up to 2 decimals, leading zero|
310+
|`#,0,,,.##B` |Billions, up to 2 decimals, leading zero|
311+
|`C`|Currency with default decimals|
312+
|`C0`| Currency with no decimals|
313+
|`C2`|Currency with 2 decimals|
314+
|`F0`|Fixed point|
315+
|`#,0;(#,0);' '`| No scaling, no decimals, leading zero, negative value shown in braces, suppress zeros|
316+
|`#,0,.##K;(#,0,.##K);' '` | Thousands, up to 2 decimals, leading zero negative value shown in braces, suppress zeros|
317+
|`#,0,,.##M;(#,0,,.##M);' '`| Millions, up to 2 decimals, leading zero negative value shown in braces, suppress zeros|
318+
|`#,0,,,.##B;(#,0,,,.##B);' '` | Billions, up to 2 decimals, leading zero negative value shown in braces, suppress zeros|
319+
|`%`|Percent sign (%) in a format string causes a number to be multiplied by 100 before it is formatted|
320+
|||
321+
127322
### See also
128-
[Visualizations (Charts)](view-data-with-visualizations-charts.md)
129-
[Actions on Visualizations (Charts)](actions-visualizations-charts.md)
130-
[Create a Chart](create-visualization-chart.md)
131-
[Use FetchXML to construct a query](../common-data-service/use-fetchxml-construct-query.md)
132-
[FetchXML schema](../common-data-service/fetchxml-schema.md)
133-
[Visualization Data Description Schema](visualization-data-description-schema.md)
134-
[Sample Charts](sample-charts.md)
135-
[Chart Class (Microsoft Chart Controls)](https://msdn.microsoft.com/library/system.web.ui.datavisualization.charting.chart.aspx)
323+
324+
[Visualizations (Charts)](view-data-with-visualizations-charts.md)
325+
[Actions on Visualizations (Charts)](actions-visualizations-charts.md)
326+
[Create a Chart](create-visualization-chart.md)
327+
[Use FetchXML to construct a query](../common-data-service/use-fetchxml-construct-query.md)
328+
[FetchXML schema](../common-data-service/fetchxml-schema.md)
329+
[Visualization Data Description Schema](visualization-data-description-schema.md)
330+
[Sample Charts](sample-charts.md)
331+
[Chart Class (Microsoft Chart Controls)](https://msdn.microsoft.com/library/system.web.ui.datavisualization.charting.chart.aspx)

0 commit comments

Comments
 (0)