Pentaho 在CDE仪表板中编辑工具提示

Pentaho 在CDE仪表板中编辑工具提示,pentaho,dashboard,Pentaho,Dashboard,如何在CDE仪表板中编辑默认工具提示?如果piechart的工具提示如下所示: Series: Fuel Category : D Value: 0.15 我想将系列、类别、值更改为其他标题。 谢谢要更改CDEdashboard工具提示,请将此函数添加到后期提取中 function f(data) { this.chartDefinition.dimensions = { series: {isHidden: true}, category: {

如何在CDE仪表板中编辑默认工具提示?如果piechart的工具提示如下所示:

Series: Fuel
Category : D
Value: 0.15
我想将系列、类别、值更改为其他标题。
谢谢

要更改CDEdashboard工具提示,请将此函数添加到后期提取中

function f(data) {    
    this.chartDefinition.dimensions = {
        series: {isHidden: true},
        category: {label: "Category"},
        value:      {label: "Value" }
    };   
    return data;
}

以下是pentaho论坛中的链接:

我试过了,它成功了

将pentaho论坛的原始答案复制到此处,由Mogsdad建议:

工具提示中按每个值显示的标签是相应标注的标签

如果要显示完全不同的工具提示,必须指定选项tooltipFormat

如果只想更改显示的标签,则只需更改标注的标签

因为维度可以用任意名称定义(即使默认名称众所周知),所以没有固定的CDE属性。 必须在JS代码中更改名称

更改默认标注的标签

将以下代码添加到CDE图表组件的postFetch处理程序中:

代码:

function f(data) {
  // Change the labels of the default dimensions
  // See http://www.webdetails.pt/charts/jsdoc/symbols/pvc.options.charts.Chart.html#dimensions
  this.chartDefinition.dimensions = {
    series:     {label: "Product Family"},
    category: {label: "Period"},
    value:      {label: "Sales" }
  };
  return data;
}
function f(data) {
   var options = this.chartDefinition;
   // It is not necessary to explicitly define dimensions
   // They are created automatically, with appropriate default properties, 
   // when referring to their names in certain other properties.
   // But we can define them anyway, if we want to change the default labels.
   // Default labels are taken from the data source, when possible,
   // or derived from the dimensions' names.
   // See http://www.webdetails.pt/charts/jsdo...tml#dimensions
   this.chartDefinition.dimensions = {
     productFamily: {label: "Product Family"},
     period: {label: "Period"},
     sales:  {label: "Sales" }
   };
   // MAP columns in the data source to corresponding dimensions
   // See http://www.webdetails.pt/charts/jsdo...t.html#readers
   options.readers = [{names: "productFamily, period, sales"}];
   // MAP dimensions to the chart's Visual Roles
   // See http://www.webdetails.pt/charts/jsdo...ml#visualRoles
   // The following can also be set as CDE properties.
   // The "series" role receives the data of the "productFamily" dimension
   // See http://www.webdetails.pt/charts/jsdo...tml#seriesRole
   options.seriesRole = "productFamily";
   // The "category" role receives the data of the "period" dimension
   // See http://www.webdetails.pt/charts/jsdo...l#categoryRole
   options.categoryRole = "period";
   // The "value" role receives the data of the "sales" dimension
   // See http://www.webdetails.pt/charts/jsdo...html#valueRole
   options.valueRole = "sales";
   return data;
}
更改标注的名称和标签

还可以更改维度的名称以匹配相应业务概念的名称:

代码:

function f(data) {
  // Change the labels of the default dimensions
  // See http://www.webdetails.pt/charts/jsdoc/symbols/pvc.options.charts.Chart.html#dimensions
  this.chartDefinition.dimensions = {
    series:     {label: "Product Family"},
    category: {label: "Period"},
    value:      {label: "Sales" }
  };
  return data;
}
function f(data) {
   var options = this.chartDefinition;
   // It is not necessary to explicitly define dimensions
   // They are created automatically, with appropriate default properties, 
   // when referring to their names in certain other properties.
   // But we can define them anyway, if we want to change the default labels.
   // Default labels are taken from the data source, when possible,
   // or derived from the dimensions' names.
   // See http://www.webdetails.pt/charts/jsdo...tml#dimensions
   this.chartDefinition.dimensions = {
     productFamily: {label: "Product Family"},
     period: {label: "Period"},
     sales:  {label: "Sales" }
   };
   // MAP columns in the data source to corresponding dimensions
   // See http://www.webdetails.pt/charts/jsdo...t.html#readers
   options.readers = [{names: "productFamily, period, sales"}];
   // MAP dimensions to the chart's Visual Roles
   // See http://www.webdetails.pt/charts/jsdo...ml#visualRoles
   // The following can also be set as CDE properties.
   // The "series" role receives the data of the "productFamily" dimension
   // See http://www.webdetails.pt/charts/jsdo...tml#seriesRole
   options.seriesRole = "productFamily";
   // The "category" role receives the data of the "period" dimension
   // See http://www.webdetails.pt/charts/jsdo...l#categoryRole
   options.categoryRole = "period";
   // The "value" role receives the data of the "sales" dimension
   // See http://www.webdetails.pt/charts/jsdo...html#valueRole
   options.valueRole = "sales";
   return data;
}

我已经有了答案,把这个函数放在预执行函数f()中,{series:[lable:somethingchange]}