English 中文(简体)
• 如何在软体2条 bar上添加标记(标签)?
原标题:How to add marker(label) on flotr2 bar stack?
  • 时间:2012-04-23 10:15:17
  •  标签:
  • flotr

I use flotr2, I wrote a test here. http://jsfiddle.net/yKqXM/

If I want to show label on each bar stack, should I use "marker" type? and how do I use it. I am new to flotr2, could you give me an good study article or docs, so I can study it. Sorry if this question is stupid, but I am frustrated of looking for the example.

问题

问题回答

Yup, 您可以使用标记特性。 确实,你可以把这种碎片放在酒吧类之后(你可以同时使用):

markers: {
  show: true,
  position:  ct ,
},

然而,这方面存在一个小问题。 Flotr2没有尊重标记的固定位置,因此标记标签将最终处于错误的位置。

为了做到这一点,建立一些星号数据集,这些数据集是星号的汇总,并将驳船和标识直接输入单独的数据来源。 列出数据之后的参照标准只是每个数据来源的“违约”模式。

标识有许多非常有用的选择。 见图书馆来源。

Flotr.addType( markers , {
    options: {
      show: false,           // => setting to true will show markers, false will hide
      lineWidth: 1,          // => line width of the rectangle around the marker
      color:  #000000 ,      // => text color
      fill: false,           // => fill or not the marekers  rectangles
      fillColor: "#FFFFFF",  // => fill color
      fillOpacity: 0.4,      // => fill opacity
      stroke: false,         // => draw the rectangle around the markers
      position:  ct ,        // => the markers position (vertical align: b, m, t, horizontal align: l, c, r)
      verticalMargin: 0,     // => the margin between the point and the text.
      labelFormatter: Flotr.defaultMarkerFormatter,
      fontSize: Flotr.defaultOptions.fontSize,
      stacked: false,        // => true if markers should be stacked
      stackingType:  b ,     // => define staching behavior, (b- bars like, a - area like) (see Issue 125 for details)
      horizontal: false      // => true if markers should be horizontal (For now only in a case on horizontal stacked bars, stacks should be calculated horizontaly)
  }




相关问题
时间表 图框架,Flotr vs AmChart

我对许多图表框架进行了比较,这两个框架是最后的争斗。 如果没有规格,则对框架进行比较毫无意义。 因此,我将阐述我的规格和......。

Flotr & Server Side Processing

Is there any way to send object / image content type created by Flotr (http://code.google.com/p/flotr/) to server side scripting. For comparison, with protovis () we can send SVG generated to server ...

Working in Mozilla but not working under IE

I am using FLotr API to draw charts , and Flotr API is internally using Prototype.js . My Charts are working fine under Mozilla , but if i run charts in IE , its giving me Script Errors . There is a ...

Capturing the Last Value inside Javascript

I am extremely sorry for the meaningless header for this Thread . I have a question (So the reason i posted this :) ) xaxis: {noTicks: 8, tickFormatter: function(n) { alert(n); } Hi ...

热门标签