Displaying event logs across data
Hi, I want to display event logs as orange vertical lines across all the data in SfChart and show the log details in tooltips. How can I achieve this?
Hi Yongkee,
Greetings from Syncfusion,
We would appreciate it if you could confirm whether the orange vertical lines shown in your screenshot are implemented as annotations, striplines, or part of a line series. This will help us better understand your setup.
Additionally, based on the screenshot, it appears that the tooltip currently displays data for only one series, which is the default. Could you please clarify:
- Are you aiming to display a shared tooltip that shows information for all series?
- Or are you looking to log the tooltip values in the console?
Once we receive your confirmation, we’ll proceed accordingly and provide you with an appropriate solution.
Please check with the below documentation link for more information about tooltip
https://blazor.syncfusion.com/documentation/chart/tool-tip
Please feel free to reach out if you have any questions or concerns.
Regards,
Durga Gopalakrishnan.
Hi Durga,
The orange log (text) is random/sparse, while other purple, teal and blue data (numeric) are more dense across time. I want the log details are shown in tooltip. Annotations and striplines seem not better fit. How can we customize a ChartSeries to be shown as vertical lines.
I aim to help users understand the connection between activity log and numerical data.
Yongkee,
Thank you for the update. You can render vertical lines using a line chart series by structuring the data source with pairs of identical X-values and null Y-values in between. This approach allows you to draw multiple vertical lines with gaps using a single line series.
Additionally, to display information from all series simultaneously, we recommend enabling the shared tooltip feature in the chart.
For your reference, we’ve prepared a sample demonstrating this approach. Please refer to the screenshot and the sample provided below.
|
<SfChart> <ChartTooltipSettings Enable="true" Shared="true" ></ChartTooltipSettings> <ChartSeriesCollection> <ChartSeries DataSource="@VietnamData" Name="Vietnam" XName="X" YName="Y"> </ChartSeries> //… <ChartSeries DataSource="@PolandData" Name="Poland" XName="X" YName="Y"> </ChartSeries> </ChartSeriesCollection> </SfChart>
@code{ public List<ChartData> PolandData = new List<ChartData> { new ChartData { X = new DateTime(2016, 01, 01), Y = 0 }, new ChartData { X = new DateTime(2016, 01, 01), Y = 25 }, new ChartData { X = new DateTime(2017, 01, 01), Y = null }, new ChartData { X = new DateTime(2018, 01, 01), Y = 0 }, new ChartData { X = new DateTime(2018, 01, 01), Y = 25 }, new ChartData { X = new DateTime(2019, 01, 01), Y = null }, //… }; } |
Sample : https://blazorplayground.syncfusion.com/LZByDzsoKjJRRdzJ
Please let us know if you have any concerns.
Hi Durga,
None of your options works for me. Would you please add vertical line options which is very common in other data science tools? Please find an example in R.
Please find the reason your options are not working.
- stripline: is a column who has start and end rather than a line
- shared: two series are not overlapping
- annotations: log data do not have y value
- chartseries: log data do not have y value
Yongkee,
We regret for the inconvenience caused. Please check with the below suggestions.
Would you please add vertical line options which is very common in other data science tools?
You can add a vertical line to the chart using a stripline by setting the SizeType property to Pixel. This approach only requires specifying the start value and the size of the stripline to render it on the chart. For your reference, we have prepared a sample demonstrating this.
Sample : https://blazorplayground.syncfusion.com/VZVItSZiAiKdZWjw
Stripline: is a column who has start and end rather than a line
You can use a stripline with the Pixel type to display a vertical line on the chart. This allows you to position the line at a specific pixel value along the axis.
Shared: two series are not overlapping
We are unclear about your exact requirement. Could you please provide more details or share an output image illustrating how you want the chart with two series to be displayed? This will help us better understand and assist you accordingly.
Annotations: log data do not have y value
You can use both X and Y values for annotations by setting the CoordinateUnit property to Point. This allows you to display annotations at specific data points by matching the annotation content with the corresponding point values.
Chartseries: log data do not have y value
We are also unclear about this part—specifically, whether you're using null values for the Y-axis and attempting to render a line series while excluding those null points. If that's the case, you can make use of the Empty Point Settings feature, which allows you to control how empty or missing data points are handled within the series.
Kindly revert us if you have any concerns.
Using Stripline with sizetype=pixel is more effective, but it doesn't completely meet my needs. I have lengthy messages for the striplines, but the Text property only displays these messages vertically next to the stripline. I wish it can be displayed as tooltips on hover.
Our data is structured as follows:
Results:
- { Time: "2022-03-21 10:31:11", Temp1: 21, Temp2: -1, Weight: 6 }
- { Time: "2022-03-21 10:31:12", Temp1: 20, Temp2: 2, Weight: 4 }
- ...
Logs:
- { Time: "2022-03-21 10:30:05", Message: "Blah Blah" }
- { Time: "2022-03-21 10:31:15", Message: "Blah Blah" }
- { Time: "2022-03-21 10:32:56", Message: "Blahd Blah" }
- ...
Since the Logs contain only text values rather than numeric values, it is challenging to plot them as a series.
Yongkee,
Query 1 : I have lengthy messages for the striplines, but the Text property only displays these messages vertically next to the stripline. I wish it can be displayed as tooltips on hover.
As of now, we don’t have support to display the tooltip for striplines. We have already logged a feature request on ”Tooltip support for striplines in the chart component”. Based on other logged tasks priority, we will include this improvement in any of our upcoming release. You can keep track of an improvement from the below feedback link.
Feedback Link : https://www.syncfusion.com/feedback/33859/tooltip-support-for-striplines-in-the-chart-component
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.
Query 2 : Since the Logs contain only text values rather than numeric values, it is challenging to plot them as a series.
Please confirm us whether you are trying to render the chart with datetime and string values? If this is not your requirement, please revert us with more details, like how you need to render the chart series specifically with which datasource format.
Please let us know if you have any concerns.
Hi Durga, regarding the Query 2. You are right. It has only date time (x) and string (y) value so i want it to be represented as a vertical line and show the string value as tooltips.
Yongkee,
As stated earlier, we don’t have support to display tooltip for stripline. You can display stripline as like your attached screenshot using foreach loop by specifying Time for Start and Text for Message. For your reference, we have attached the modified sample.
|
<SfChart> <ChartPrimaryXAxis> <ChartStriplines> @foreach (var log in Logs) { <ChartStripline Start="log.Time" Text="@log.Message" Color="orange" SizeType="SizeType.Pixel" HorizontalAlignment="Anchor.End"> <ChartStriplineTextStyle Size="12px" Color="black" FontFamily="Arial" /> </ChartStripline> } </ChartStriplines> </ChartPrimaryXAxis> </SfChart>
@code { private List<LogEntry> Logs = new List<LogEntry> { new LogEntry { Time = new DateTime(2017, 01, 01), Message = "Blah Blah" }, new LogEntry { Time = new DateTime(2019, 01, 01), Message = "Blah Blah" }, new LogEntry { Time = new DateTime(2020, 01, 01), Message = "Blahd Blah" } }; } |
Sample : https://blazorplayground.syncfusion.com/VDBoteZHgminAFIX
Please let us know if you have any concerns.
- 10 Replies
- 2 Participants
-
YC Yongkee Cho
- Apr 13, 2025 01:46 PM UTC
- May 6, 2025 12:17 PM UTC