Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooltip #667

Closed
luanaanalist opened this issue Mar 24, 2017 · 7 comments
Closed

tooltip #667

luanaanalist opened this issue Mar 24, 2017 · 7 comments

Comments

@luanaanalist
Copy link

I have a working example, but this example is serious, however, giving release to coloar the format I do not want to tooltip the graph!
In the print below, you may notice that it is unformatted, but I might want to post "R $ 20.00" or "Value: 20.00", present it in a customized way

https://jsfiddle.net/nicolaskruchten/gq6w05j8/

@nicolaskruchten
Copy link
Owner

I'm having trouble understanding what you're looking for, but I think you want to customize the chart tooltip?

If that's right, you will have to pass through some C3js directives to the renderer.

Here is how C3js allows you to customize tooltips: http://c3js.org/samples/tooltip_format.html

Here is an example that shows how to pass parameters through to C3js: http://nicolas.kruchten.com/pivottable/examples/scatter.html

@luanaanalist
Copy link
Author

Yes, exactly that.
How do I step by parameter an entire row of the table?

                   RendererOptions: {
                          C3: {
                              Dica de ferramenta: {
                                  Format: {
                                     // title: function (d) {return 'Dados' + d; },
                                      Valor: função (valor, razão, id, Tipo, Terminal) {
                                          Console.log (Terminal);
                                          If (Tipo == 2) {
                                              Return Ext.util.Format.number (value, "R $ 0,000.00")
                                          }
                                          If (Tipo == 0) {
                                              Return Ext.util.Format.number (value, "0,000.00")
                                          }
                                          outro {
                                              Retornar Ext.util.Format.number (valor, "0,000")
                                          }
                                         
                                      }
                                      // value: d3.format (',') // aplica este formato a y e y2
                                  }
                              }
                          }
                      },

@luanaanalist
Copy link
Author

               rendererOptions: {
                      c3: {
                          tooltip: {
                              format: {
                                 // title: function (d) { return 'Data ' + d; },
                                  value: function (value, ratio, id, Tipo, Terminal) {
                                      console.log(Terminal);
                                      if (Tipo == 2) {
                                          return Ext.util.Format.number(value, "R$0,000.00")
                                      }
                                      if (Tipo == 0) {
                                          return Ext.util.Format.number(value, "0,000.00")
                                      }
                                      else {
                                          return Ext.util.Format.number(value, "0,000")
                                      }
                                     
                                  }
                                  //            value: d3.format(',') // apply this format to both y and y2
                              }
                          }
                      }
                  },

@nicolaskruchten
Copy link
Owner

I'm sorry, I don't understand what you mean by "step by parameter an entire row of the table" ... Can you clarify please?

@luanaanalist
Copy link
Author

It's because I have a column called Type, which can assume "minute", "quantity" or "value" and I need this field without tooltip for each type I insert a formatting

example
rendererOptions: {
c3: {
tooltip: {
format: {
// title: function (d) { return 'Data ' + d; },
value: function (value, ratio, id, Tipo, cols) {
if (Type== "Minut") {
return Ext.util.Format.number(value, "R$0,000.00")
}

                                  }
                                  //            value: d3.format(',') // apply this format to both y and y2
                              }
                          }
                      }
                  },

@nicolaskruchten
Copy link
Owner

I don't think you will be able to have conditional formatting on your tooltips in this way, sorry :(

@nicolaskruchten
Copy link
Owner

Update: the C3 charts now use the aggregator's number formatters, which doesn't give you exactly what you wanted but goes partway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants