Skip to content

Commit 105d9a8

Browse files
996523: Done content and sample correction in the stripline tooltip UG.
1 parent fecf2ce commit 105d9a8

File tree

4 files changed

+66
-4
lines changed

4 files changed

+66
-4
lines changed
31.6 KB
Loading
33.8 KB
Loading
-35.8 KB
Binary file not shown.

blazor/chart/strip-line.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,67 @@ To create a stripline in a specific region with respect to a segment (segmented
250250

251251
## Stripline tooltip
252252

253-
Stripline tooltips provide additional contextual information on interaction with striplines in the chart. To display a tooltip on a stripline, add the **ChartStriplineTooltip** component inside the desired **ChartStripline** and set the **Enable** property to **true**. This feature is particularly useful for explaining the significance of specific ranges or thresholds marked by striplines.
253+
Stripline tooltips provide additional contextual information on interaction with striplines in the chart. To display a tooltip on a stripline, add the **ChartStriplineTooltip** component inside the desired **ChartStripline** and set the **Enable** property to **true**. It is particularly useful for explaining the significance of specific ranges or thresholds marked by striplines.
254+
255+
### Default stripline tooltip code example:
256+
257+
Below is the simplest way to enable a stripline tooltip using default settings. The tooltip will display on interaction with the stripline.
258+
259+
```cshtml
260+
261+
@using Syncfusion.Blazor.Charts
262+
263+
<SfChart Title="Vehicle Traffic by Time">
264+
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
265+
IntervalType="IntervalType.Hours"
266+
LabelFormat="h tt">
267+
<ChartStriplines>
268+
<ChartStripline Start="new DateTime(2024, 01, 01, 07, 00, 00)"
269+
End="new DateTime(2024, 01, 01, 09, 00, 00)"
270+
Text="Rush Hour"
271+
Color="#FFED4A"
272+
Visible="true">
273+
<ChartStriplineTooltip Enable="true"></ChartStriplineTooltip>
274+
</ChartStripline>
275+
</ChartStriplines>
276+
</ChartPrimaryXAxis>
277+
278+
<ChartPrimaryYAxis Minimum="0" Maximum="1400" Interval="200" Title="Number of vehicles">
279+
</ChartPrimaryYAxis>
280+
281+
<ChartSeriesCollection>
282+
<!-- Vibrant spline series color -->
283+
<ChartSeries Type="ChartSeriesType.Spline"
284+
DataSource="@Traffic"
285+
XName="Time"
286+
YName="Vehicles"
287+
Width="2"
288+
Fill="#F43F5E">
289+
</ChartSeries>
290+
</ChartSeriesCollection>
291+
</SfChart>
292+
293+
@code {
294+
public class TrafficPoint
295+
{
296+
public DateTime Time { get; set; }
297+
public double Vehicles { get; set; }
298+
}
299+
300+
public List<TrafficPoint> Traffic = new ()
301+
{
302+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 06, 00, 00), Vehicles = 380 },
303+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 07, 00, 00), Vehicles = 820 },
304+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 08, 00, 00), Vehicles = 1200 },
305+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 09, 00, 00), Vehicles = 980 },
306+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 10, 00, 00), Vehicles = 650 },
307+
new TrafficPoint { Time = new DateTime(2024, 01, 01, 11, 00, 00), Vehicles = 520 }
308+
};
309+
}
310+
311+
```
312+
313+
![Blazor Chart with Default Stripline Tooltip](images/strip-line/blazor-chart-stripline-tooltip-default.png)
254314

255315
### Tooltip customization properties
256316

@@ -292,6 +352,8 @@ The **ChartStriplineTooltipBorder** component enables you to add and customize b
292352

293353
- **Color** - Defines the color of the tooltip border. Accepts any valid CSS color value.
294354

355+
### Customized stripline tooltip code example:
356+
295357
```cshtml
296358
297359
@using Syncfusion.Blazor.Charts
@@ -338,15 +400,15 @@ The **ChartStriplineTooltipBorder** component enables you to add and customize b
338400
public double Revenue { get; set; }
339401
}
340402
341-
public List<RevenuePoint> SalesData = new()
403+
public List<RevenuePoint> SalesData = new ()
342404
{
343405
new RevenuePoint { Quarter = "Q1", Revenue = 78 },
344406
new RevenuePoint { Quarter = "Q2", Revenue = 88 },
345407
new RevenuePoint { Quarter = "Q3", Revenue = 99 },
346408
new RevenuePoint { Quarter = "Q4", Revenue = 92 }
347409
};
348410
349-
public List<RevenuePoint> SupportData = new()
411+
public List<RevenuePoint> SupportData = new ()
350412
{
351413
new RevenuePoint { Quarter = "Q1", Revenue = 70 },
352414
new RevenuePoint { Quarter = "Q2", Revenue = 83 },
@@ -357,7 +419,7 @@ The **ChartStriplineTooltipBorder** component enables you to add and customize b
357419
358420
```
359421

360-
![Blazor Chart with Stripline Tooltip](images/strip-line/blazor-chart-stripline-tooltip.png)
422+
![Blazor Chart with Customized Stripline Tooltip](images/strip-line/blazor-chart-stripline-tooltip-customized.png)
361423

362424
N> Refer to our [Blazor Charts](https://www.syncfusion.com/blazor-components/blazor-charts) feature tour page for its groundbreaking feature representations and also explore our [Blazor Chart Example](https://blazor.syncfusion.com/demos/chart/line?theme=bootstrap5) to know various chart types and how to represent time-dependent data, showing trends at equal intervals.
363425

0 commit comments

Comments
 (0)