Skip to content

Commit 2cf793b

Browse files
Chart tooltip docs update (#86)
* chore(chart): removed padding and border from chart tooltip docs * chore(chart): updated chart tooltip context template * chore(chart): improvements to chart tooltip context template file * docs(chart): minor improvements on tooltip context details * chore(chart): updated common tooltip gif size * chore(chart): updated chart tooltip overview article Co-authored-by: Marin Bratanov <m.bratanov@gmail.com>
1 parent fdfc7a7 commit 2cf793b

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

_contentTemplates/chart/chart-tooltip-context-templates.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
* `FormattedValue` - maps to the default rendering of the tooltip, formatted as a string.
33
* Use this when the chart's data is bound by [Independent Series Binding]({%slug components/chart/databind%}#independent-series-binding). You can parse this to a numerical value (`int`, `double`, etc.) in order to apply formatting. Otherwise, use the `DataItem` to get the value of the point.
44

5-
* `DataItem` - provides the data model of the current series item. You may need to cast it to its type.
5+
* `DataItem` - provides the data model of the current series item. You need to cast it to the type from your datasource, which needs to be serializable.
6+
7+
* If you are using a [Date Axis]({%slug components/chart/date-axis%}), the `DataItem` will contain the only the aggregated value in the corresponding y-value field, because it is a collection of more than one items. See the `Category` below for details.
8+
9+
* `Category` - provides information on the category the data point is located in. You need to cast it to the type in your data source, for example `DateTime`, `string`, `int` or another type. The `Category` parameter is applicable to [Categorical Charts]({%slug components/chart/databind%}#series-types).
10+
11+
* When using a [Date Axis]({%slug components/chart/date-axis%}), you can use it, together with the `BaseUnit` value of the axis, to filter the data source and obtain the actual data items from the data source in case you want to provide extra information about them.
612

713
* `Percentage` - applicable to [Donut]({%slug components/chart/types/donut%}), [Pie]({%slug components/chart/types/pie%}) and [Stacked 100%]({%slug components/chart/stack%}#stack-100) Charts - the percentage value of the current data point from the whole.
814

@@ -22,8 +28,4 @@
2228
* `Color` - control the text color by applying a CSS color string, including HEX and RGB.
2329

2430
* `Opacity` - control the opacity of the tooltip.
25-
26-
* `Border` - control the `Color` and the `Width` of the tooltip by using the `<ChartSeriesTooltipBorder />` nested inside the `<ChartSeriesTooltip>` tag.
27-
28-
* `Padding` - control the `Left`, `Right`, `Top` and `Bottom` padding of the tooltip by using the `<ChartSeriesTooltipPadding />` nested inside the `<ChartSeriesTooltip>` tag.
2931
#end
-6.66 KB
Loading

components/chart/tooltip/overview.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ You can customize the appearance of the individual series tooltip by using:
129129

130130
* `Color` - control the text color by applying a CSS color string, including HEX and RGB.
131131

132-
* `Border` - control the `Color` and the `Width` of the tooltip by using the `<ChartSeriesTooltipBorder />` nested inside the `<ChartSeriesTooltip>` tag.
133-
134-
* `Padding` - control the `Left`, `Right`, `Top` and `Bottom` padding of the tooltip by using the `<ChartSeriesTooltipPadding />` nested inside the `<ChartSeriesTooltip>` tag.
135-
136132
* Use the [Template](#template) to take control over what is rendered in the tooltip.
137133

138134
>caption Configuration of the tooltips with applied customization settings
@@ -149,8 +145,6 @@ You can customize the appearance of the individual series tooltip by using:
149145
<ChartSeriesTooltip Visible="true"
150146
Background="#0000FF"
151147
Color="#D3D3D3">
152-
<ChartSeriesTooltipBorder Color="#ADD8E6" Width="10" />
153-
<ChartSeriesTooltipPadding Top="10" Bottom="10" Left="15" Right="15" />
154148
</ChartSeriesTooltip>
155149
</ChartSeries>
156150
</ChartSeriesItems>
@@ -199,7 +193,7 @@ You can customize the appearance of the individual series tooltip by using:
199193

200194
#### Common Tooltip Settings
201195

202-
In a similar fashion, you can declare these settings in the common tooltip section. Their tag names are slightly different, however:
196+
In a similar fashion, you can declare these settings in the common tooltip section:
203197

204198
@[template](/_contentTemplates/chart/chart-tooltip-context-templates.md#shared-tooltip-parameter-settings)
205199

@@ -264,7 +258,7 @@ The available series data point information in the `context` is:
264258
}
265259
266260
public List<MyDataModel> modelData = new List<MyDataModel>()
267-
{
261+
{
268262
new MyDataModel() { SecondSeriesValue = 1, ExtraData = "first" },
269263
new MyDataModel() { SecondSeriesValue = 5, ExtraData = "second" },
270264
new MyDataModel() { SecondSeriesValue = 3, ExtraData = "third" },

0 commit comments

Comments
 (0)