Rank: Newbie
Groups: Registered
Joined: 2/12/2020(UTC) Posts: 7 Location: SC Thanks: 4 times
|
Hello. Please how to put captions on the axes in JS and NVD3 graphics? thanks Edited by user Tuesday, February 18, 2020 3:28:35 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
You can use the 'Title' or 'Chart Title' property of the related Chart View.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/12/2020(UTC) Posts: 7 Location: SC Thanks: 4 times
|
Sorry, I think I was not specific enough, I need to identify the axes of the graph. For example, the x-axis appears with the caption "DATE" and the y-axis shows the caption "VALUES".
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Yes, there are properties for Plotly: 'X Axis title' and 'Y axis title' for Chartjs, you have to use labelling: https://www.chartjs.org/...test/axes/labelling.htmlselect your ChartJS view, then edit your custom template (around line 130): Code:
@(chartType != "horizontalBar" ? "x" : "y")Axes: [{
offset: true,
display: @view.GetBoolValueJS("chartjs_show_xaxis"),
stacked: @Helper.ToJS(reportModel.ExecChartJSType == "bar" && view.GetBoolValue("chartjs_bar_stacked")),
scaleLabel: {
display: true,
labelString: 'My axis label'
},
and for the other axis (around line 157): Code: ticks: {
callback: function (label, index, labels) {
if (@Helper.ToJS(reportModel.ExecAxisPrimaryYIsDateTime)) return d3.timeFormat('@Raw(Helper.ToJS(reportModel.ExecD3PrimaryYAxisFormat))')(new Date(label));
return d3.format('@Raw(Helper.ToJS(reportModel.ExecD3PrimaryYAxisFormat))')(label).valueFormat();
}
},
scaleLabel: {
display: true,
labelString: 'My other axis label'
}
},
I will check if we can integrate this in the next version...
|
1 user thanked epf for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/12/2020(UTC) Posts: 7 Location: SC Thanks: 4 times
|
Thank you very much. It funcinated very well.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.