Dear Sir,
We would like to design a SfChart (Blazor) with 2 axes having the same scale: 1 length unit in vertical axis equals 1 length unit in horizontal axis.
I tried to use different solutions but failed to get this requirement from Line Chart. Please advise us how to get this work.
Thanks a lot for your support.
Best regards,
Brian
|
<SfChart>
<ChartPrimaryXAxis Title="In Kilograms" Minimum="0" Maximum="6" Interval="1">
</ChartPrimaryXAxis>
<ChartPrimaryYAxis Title="In Grams" LabelFormat="{value}g" Minimum="0" Maximum="6000" Interval="1000">
</ChartPrimaryYAxis>
</SfChart> |
Hi Durga,
Thanks a lot for quick reply. I attached here the zip file having some snapshots and more details about what issue we are facing when trying to use Syncfusion Blazor Chart for proportional view. I had some questions in comments in code.
Briefly there are several questions:
|
<SfChart>
<ChartEvents OnAxisActualRangeCalculated="RangeCalculated"></ChartEvents>
</SfChart>
@code{
public void RangeCalculated(AxisRangeCalculatedEventArgs Args)
{
if (Count == 0)
{
XMin = Args.Minimum;
XMax = Args.Maximum;
}
else if(Count == 1)
{
YMin = Args.Minimum;
YMax = Args.Maximum;
Args.Minimum = -100; // change minimum based on your requirement
}
Count = Count + 1;
}
} |
Hi Durga,
Thanks a lot for answers. We have some further questions about this topic:
Hi Durga,
Thanks a lot for the support. I think I am very close to what I need to set iso-view for the chart, the only thing we need is chart rectangle data (width and height) as attached snapshot. Perhaps the nomenclature we are using to define the problems is confusing. A better description may be isoaxis, in that the divisions on both the y and x axes is the same; such that the actual distance as measured by a ruler is the same from 0 to 100, for example, on both axes. The driving parameter is that distance, not really the range. This type of grid is necessary when dealing with survey data or other areas of geometry and physics and design in which angles are important. I hope this helps clarify the problem.
We are looking forward to hearing from you soon.
Thanks,
Vu
Hi Baby,
Thank you so much for the reply. We greatly appreciate about adding axis name to the event "OnAxisActualRangeCalculated" for better handling information about a chart. We deeply understand why your company locks some properties for public access because of security or any reason. But it is great if your company can enable a special chart (iso-view) as we described in previous discussions, because it is critical for some industries, such as survey, oil, education ...
We are looking forward to hearing from you soon.
Best regards,
Vu
Hi Durga,
We DON'T have a plan to MODIFY chart area bounds, we just need that information to calculate the scale on axis X, from that we can apply the same scale to axis Y. That is our original request from the day 1. Without chart area bounds's data, how can we calculate the scale for a specific axis based on the minimum and maximum values from the event "OnAxisActualRangeCalculated"?
For example for axis X:
+ Minimum value: -500 ft.
+ Maximum value: 2000 ft.
+ Left boundary: 200 px. (get from chart area bounds)
+ Right boundary: 1000 px. (get from chart area bounds)
Delta value (ft) from measurements: (2000-(-500))=2500 ft.
Delta value (px) on the chart: 1000-200=800 px
So we can conclude that the SCALE on X axis is: 2500/800 = 3.125 ft/px
If we set axis X interval = 500 ft., so one interval on axis has 500/31.25= 160 px.
Then we just apply the same scale (3.125 ft/px) to the Y axis by adjusted the min or max value for the Y axis in the event "OnAxisActualRangeCalculated ", we will iso-view as discussed before. When dealing with that event, for instance we know about Y axis information as below:
+ Minimum value: -1000 ft
+ Maximum value: 3000 ft (We have to adjust THIS VALUE from this event to get iso-view)
+ Top boundary: 100 px (get from chart area bounds)
+ Bottom boundary: 1300 px (get from chart area bounds)
We will form the formula to get iso-view: 3.125 = (args.Maximum - (-1000)) / (1300-100)
So the adjusted MAXIMUM value for the Y axis is: args.Maximum = 2750 ft.
Let double check the scale on Y axis after set its Maximum value: (2750 - (-1000)) / (1300-100) = 3.125 , which is the same scale on X axis. So you see we DON'T have to change anything about chart area bounds, they are just so we can get the adjusted value for MAXIMUM or MINIMUM value on one axis to get proper iso-view.
We are looking forward to hearing from you soon.
Best regards,
Vu
Hi Baby,
Thank you very much for your support on this request. It helps us to advance on current projects.
Best regards,
Vu Nguyen
281-777-2384
|
public void RangeCalculated(AxisRangeCalculatedEventArgs Args)
{
Console.WriteLine(Args.AxisName);
} |
Hi Durga,
Thank you so much for the email with detail instructions. We downloaded and ran the sample project with the custom Nuget Package. We have some feedback as below:
|
public void RangeCalculated(AxisRangeCalculatedEventArgs Args)
{
if(!Double.IsNaN(Args.Bounds.X) && !Double.IsNaN(Args.Bounds.Y) && !Double.IsNaN(Args.Bounds.Height) && !Double.IsNaN(Args.Bounds.Width))
{
if(Args.AxisName == "PrimaryYAxis" && Count < 1)
{
Count++;
var Y = Args.Bounds.Y;
var Height = Args.Bounds.Height;
Console.WriteLine(Y);
Console.WriteLine(Height);
}
else if(Args.AxisName == "PrimaryXAxis" && Count < 3)
{
Count++;
var X = Args.Bounds.X;
var Width = Args.Bounds.Width;
Console.WriteLine(X);
Console.WriteLine(Width);
}
}
} |
Hi Durga,
Thanks a lot for the latest sample. When importing the custom package (19.2.0.56) to our real project, we are facing the multiple errors with other controls from Syncfusion.Blazor. Please review the attached snapshots and give us your feedback.
We are looking forward to hearing from you soon.
Best regards,
Vu Nguyen
281-777-2384
Hi Durga,
Thanks a lot for your feedback. We are looking forward to downloading the latest release tomorrow.
Best regards,
Vu Nguyen
281-777-2384
Hi Durga,
Thanks a lot for the email. We downloaded, installed and deployed the latest release v19.2.51 to our project and it runs OK.
We have some questions about components libraries which your company offer for customers:
2. Can we use 2 libraries in the same website?
We are looking forward to hearing from you soon.
Best regards,
Vu Nguyen
281-777-2384