Annotations on Log Chart
I was having difficulty getting the Annotations to appear on a chart and it seems that Annotations do not display when the axis ValueType is Logarithmic.
Here is a sample from the documentation. Merely switch the YAxis from Logarithmic to Double and the annotation will appear.
```
@using Syncfusion.Blazor.Charts
<SfChart Title="Olympic Medals">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category">
</ChartPrimaryXAxis>
<ChartPrimaryYAxis LabelFormat="{value}" Title="Medals" ValueType="Syncfusion.Blazor.Charts.ValueType.Logarithmic">
<ChartAxisLineStyle Width="0"></ChartAxisLineStyle>
<ChartAxisMajorTickLines Width="0"></ChartAxisMajorTickLines>
</ChartPrimaryYAxis>
<ChartAnnotations>
<ChartAnnotation X="@data" Y="65" CoordinateUnits="Units.Point">
<ContentTemplate>
<div style="color: firebrick; font-size: medium; font-style: italic">Highest Medal Count</div>
</ContentTemplate>
</ChartAnnotation>
</ChartAnnotations>
<ChartSeriesCollection>
<ChartSeries DataSource="@MedalDetails" XName="Country" YName="Gold" Type="ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code{
string data = "France";
public class ChartData
{
public string Country { get; set; }
public double Gold { get; set; }
}
public List<ChartData> MedalDetails = new List<ChartData>
{
new ChartData{ Country= "USA", Gold=50 },
new ChartData{ Country= "China", Gold=40 },
new ChartData{ Country= "Japan", Gold=70 },
new ChartData{ Country= "Australia", Gold=60},
new ChartData{ Country= "France", Gold=50 },
new ChartData{ Country= "Germany", Gold=40 },
new ChartData{ Country= "Italy", Gold=40 },
new ChartData{ Country= "Sweden", Gold=30 }
};
}
```
Thanks,
Joe
Hi Joseph,
Greetings from Syncfusion.
We have considered your reported scenario as bug and logged a defect report for the issue ”Chart annotations are not displayed for logarithmic axis”. This fix will be available in our weekly patch release which is scheduled to be rolled out on 12th November 2024. We appreciate your patience until then. You can keep track of the bug from the below feedback link.
Feedback : https://www.syncfusion.com/feedback/62476/chart-annotations-are-not-displayed-for-logarithmic-axis
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.
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Durga Gopalakrishnan.
Joseph,
We are glad to announce that our Essential Studio® 2024 Volume 3 Service Pack Release v27.2.2 is rolled out; we have added the fix for reported issue and is available for download under the following link.
Feedback Link : https://www.syncfusion.com/feedback/62476/chart-annotations-are-not-displayed-for-logarithmic-axis
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Annotation-197234137.zip
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
- 2 Replies
- 2 Participants
-
JM Joseph Murray
- Oct 22, 2024 09:15 PM UTC
- Nov 16, 2024 06:01 AM UTC