Skip to content

Commit 000474a

Browse files
996523: Provided UG documentation support for the stripline tooltip feature.
1 parent fa6eb9f commit 000474a

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
31.7 KB
Loading

blazor/chart/strip-line.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,86 @@ To create a stripline in a specific region with respect to a segment (segmented
248248
```
249249
{% previewsample "https://blazorplayground.syncfusion.com/embed/rNLqMVhHrJGZtGLh?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Chart With Segmented Stripline](../chart/images/strip-line/blazor-chart-segmented-stripline.png)" %}
250250

251+
## Stripline tooltip
252+
253+
To enable the stripline tooltip add **ChartStriplineTooltip** inside the target Stripline and set **Enable** property to **true**. Use **Header** and **Content** properties to customize the tooltip's content, adjust visual emphasis with **Fill** and **Opacity** properties and style the tooltip's text and border with **ChartStriplineTooltipTextStyle** and **ChartStriplineTooltipBorder** properties.
254+
255+
- Enable - Enables the stripline tooltip.
256+
- Header - Sets the tooltip title text.
257+
- Fill - Sets background color of the tooltip.
258+
- Opacity - Sets transparency of the tooltip (0 to 1).
259+
- Content - Template string for tooltip body content.
260+
- ShowHeaderLine - Shows or hides the header separator line.
261+
- ChartStriplineTooltipTextStyle - Configures the tooltip text (size, color, weight, family).
262+
- ChartStriplineTooltipBorder - Configures the tooltip border (color, width).
263+
264+
```cshtml
265+
266+
@using Syncfusion.Blazor.Charts
267+
268+
<SfChart Title="Department Revenue by Quarter">
269+
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category">
270+
<ChartAxisMajorGridLines Width="0"></ChartAxisMajorGridLines>
271+
<ChartAxisMajorTickLines Width="0"></ChartAxisMajorTickLines>
272+
</ChartPrimaryXAxis>
273+
274+
<ChartPrimaryYAxis Minimum="65" Maximum="110" Interval="5" LabelFormat="${value}k" RangePadding="Syncfusion.Blazor.Charts.ChartRangePadding.None">
275+
<ChartAxisMajorTickLines Width="0"></ChartAxisMajorTickLines>
276+
<ChartStriplines>
277+
<ChartStripline Start="95" End="110" Text="Target Exceeded" Color="#FFE3B3" HorizontalAlignment="Anchor.Middle" Visible="true">
278+
<ChartStriplineTextStyle Size="12px" Color="#0b3a66" FontWeight="600"></ChartStriplineTextStyle>
279+
<ChartStriplineBorder Width="0"></ChartStriplineBorder>
280+
<ChartStriplineTooltip Enable="true" Header="Target Exceeded">
281+
<ChartStriplineTooltipTextStyle Size="12px" FontWeight="500"></ChartStriplineTooltipTextStyle>
282+
<ChartStriplineTooltipBorder Width="0"></ChartStriplineTooltipBorder>
283+
</ChartStriplineTooltip>
284+
</ChartStripline>
285+
</ChartStriplines>
286+
</ChartPrimaryYAxis>
287+
288+
<ChartSeriesCollection>
289+
<ChartSeries Name="Sales" Type="ChartSeriesType.Column" DataSource="@SalesData" XName="Quarter" YName="Revenue" ColumnSpacing="0.2" Width="2" Fill="#ef4444">
290+
<ChartMarker Visible="false"></ChartMarker>
291+
</ChartSeries>
292+
<ChartSeries Name="Support" Type="ChartSeriesType.Spline" DataSource="@SupportData" XName="Quarter" YName="Revenue" Width="2" Fill="#3b82f6">
293+
<ChartMarker Visible="true">
294+
<ChartDataLabel Visible="true"></ChartDataLabel>
295+
</ChartMarker>
296+
</ChartSeries>
297+
</ChartSeriesCollection>
298+
299+
<ChartLegendSettings Visible="true" EnableHighlight="true">
300+
</ChartLegendSettings>
301+
</SfChart>
302+
303+
@code {
304+
public class RevenuePoint
305+
{
306+
public string Quarter { get; set; }
307+
public double Revenue { get; set; }
308+
}
309+
310+
public List<RevenuePoint> SalesData = new()
311+
{
312+
new RevenuePoint { Quarter = "Q1", Revenue = 78 },
313+
new RevenuePoint { Quarter = "Q2", Revenue = 88 },
314+
new RevenuePoint { Quarter = "Q3", Revenue = 99 },
315+
new RevenuePoint { Quarter = "Q4", Revenue = 92 }
316+
};
317+
318+
public List<RevenuePoint> SupportData = new()
319+
{
320+
new RevenuePoint { Quarter = "Q1", Revenue = 70 },
321+
new RevenuePoint { Quarter = "Q2", Revenue = 83 },
322+
new RevenuePoint { Quarter = "Q3", Revenue = 90 },
323+
new RevenuePoint { Quarter = "Q4", Revenue = 85 }
324+
};
325+
}
326+
327+
```
328+
329+
![Blazor Chart with Stripline Tooltip](images/strip-line/blazor-chart-stripline-tooltip.png)
330+
251331
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.
252332

253333
## See also

0 commit comments

Comments
 (0)