logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Roberto  
#1 Posted : Tuesday, February 18, 2020 3:27:39 PM(UTC)
Roberto

Rank: Newbie

Groups: Registered
Joined: 2/12/2020(UTC)
Posts: 7
Brazil
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

epf  
#2 Posted : Wednesday, February 19, 2020 7:21:05 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 880
Switzerland

Thanks: 14 times
Was thanked: 150 time(s) in 144 post(s)
You can use the 'Title' or 'Chart Title' property of the related Chart View.
Roberto  
#3 Posted : Wednesday, February 19, 2020 11:06:54 AM(UTC)
Roberto

Rank: Newbie

Groups: Registered
Joined: 2/12/2020(UTC)
Posts: 7
Brazil
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".
epf  
#4 Posted : Wednesday, February 19, 2020 1:27:35 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 880
Switzerland

Thanks: 14 times
Was thanked: 150 time(s) in 144 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.html

select 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...

thanks 1 user thanked epf for this useful post.
Roberto on 2/19/2020(UTC)
Roberto  
#5 Posted : Wednesday, February 19, 2020 4:03:51 PM(UTC)
Roberto

Rank: Newbie

Groups: Registered
Joined: 2/12/2020(UTC)
Posts: 7
Brazil
Location: SC

Thanks: 4 times
Thank you very much. It funcinated very well.
Users browsing this topic
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.