Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

OpenERP 7 Graph view add title in X-axis and Y-axis

By
Prakash
on 6/25/14, 3:05 AM 2,223 views

OpenERP 7 how to add title in X-axis and Y-axis in the Particular Module Graph view?...

To add title  in the \addons\web_graph\static\lib\flotr2\js\DefaultOptions.js  File options avaiable to add title in x-axis and y-axis.

Flotr.defaultOptions = {
   xaxis: {
    ticks: null,           // => format: either [1, 3] or [[1, 'a'], 3]
    minorTicks: null,      // => format: either [1, 3] or [[1, 'a'], 3]
    showLabels: true,      // => setting to true will show the axis ticks labels, hide otherwise
    showMinorLabels: false,// => true to show the axis minor ticks labels, false to hide
    labelsAngle: 0,        // => labels' angle, in degrees
    title: null,           // => axis title
    titleAngle: 0,         // => axis title's angle, in degrees
  },
  x2axis: {},
  yaxis: {
   title: null,           // => axis title
    titleAngle: 90,        // => axis title's angle, in degrees   
  },
  y2axis: {
    titleAngle: 270
  },
};

But the title shows in all the graph. How to add the title in Particular Graph?...  In java script which methods to override and shows title in particular Graph ?..

 

 

 

 

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 6/25/14, 9:09 AM

Graph view Added title using the below code

\addons\web_graph\static\src\js\graph.js

  make_graph: function (mode, container, data) {
        if (mode === 'area') { mode = 'line'; }
        var format = this.get_format(this['options_' + mode](data));
        /* The below if statement is added for Custome Module */
        if (this.dataset.model == 'custom.module')
          {
            format['xaxis']['title'] = 'x-axis title';
            format['yaxis']['title'] = 'y-axis title';
        }
        return Flotr.draw(container, data.data, format);
    },

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/25/14, 3:05 AM
Seen: 2223 times
Last updated: 3/16/15, 8:10 AM