|
ASP.NET MVC:
@(Html.EJ().Chart("container")
//...
.PointRegionClick("chartPointClick")
)
function chartPointClick(sender) {
//Create div element dynamically
var menu = document.createElement("div");
menu.id = "shipDetails";
//Data Source for menu component
var data = [
//...
];
$("#shipDetails").ejMenu({
//...
})
}
|
|
Query |
Response | |
|
I have been trying to replicate what you did with "Point Visibility" and apply it to the series but i haven't succeed. |
From the provided code snippet, we found that you have specified visible property as false to hide the series. But to hide the series, you need to specify the series.visibility as hidden. Find the code snippet below to achieve this scenario.
Here we have toggled the visibility of the series. You can change this with respect to your requirement.
| |
|
I am trying to add the plot of linear regression and mean, to the option menu. I know that the linear regression i can accomplish with trendlines. |
We have added trendline to the chart and added the menu for toggling the trendline visibility. Find the code snippet below to achieve this requirement.
You can change this scenario with respect to your requirement. For more information in trendlines, kindly follow the link below.
| |
|
I want also to be able to plot objectives(line), in order to be able to compare with the mean. |
We have added mean values in the menu and by selecting the mean value, a line will be drawn for the selected mean value over the chart. Find the code snippet to achieve this requirement.
Screenshot before adding line for mean value:
Screenshot after adding line for mean value:
Sample for reference can be find from below link.
If this is not your exact requirement, kindly revert us with more information on your requirement or with some screenshots for your requirement. This will be helpful in further analysis and provide you the solution sooner.
|
|
ASP.NET MVC:
@(Html.EJ().Chart("container")
//...
.ChartMouseMove("chartMouseMoved")
)
function chartMouseMoved(sender) {
var meanTooltip = document.getElementById("meanTool");
//...
if (sender.data.id == this._id + "_svg_StriplineOver" || sender.data.id == this._id + "_svg_StriplineOver_striplineRect_1_0") {
var ser = [], series = sender.model.series[0];
//Get the closest point using getNearestPoint method
var nearPoint = getNearestPoint(ser, series, sender.data.location.x, sender.data.location.y);
//Specify the required text to display in tooltip
meanTooltip.innerText = nearPoint.point[0].x + " : " + sender.model.primaryYAxis.stripLine[0].start;
//Specify the location for tooltip and required CSS styles
$("#meanTool").css({
'top': sender.data.location.y + sender.model.m_AreaBounds.Y,
'left': sender.data.location.x + sender.model.m_AreaBounds.X,
//...
})
}
}
|