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

hover detail doesn't work. #77

Open
veetase opened this issue Jun 26, 2015 · 3 comments
Open

hover detail doesn't work. #77

veetase opened this issue Jun 26, 2015 · 3 comments

Comments

@veetase
Copy link

veetase commented Jun 26, 2015

my code is as blew.

class Dashing.Graph extends Dashing.Widget
  @accessor 'current', ->
    return @get('displayedValue') if @get('displayedValue')
    points = @get('points')
    if points
      points[points.length - 1].y

  ready: ->
    container = $(@node).parent()
    # Gross hacks. Let's fix this.
    width = (Dashing.widget_base_dimensions[0] * container.data("sizex")) + Dashing.widget_margins[0] * 2 * (container.data("sizex") - 1)
    height = (Dashing.widget_base_dimensions[1] * container.data("sizey"))
    @graph = new Rickshaw.Graph(
      element: @node
      width: width
      height: height
      renderer: 'line'
      series: [
        {
        color: 'steelblue',
        data: [{x:0, y:0}]
        }
      ]
      padding: {top: 0.02, left: 0.02, right: 0.02, bottom: 0.02}
    )

    @graph.series[0].data = @get('points') if @get('points')
    hoverDetail = new Rickshaw.Graph.HoverDetail(graph: @graph)
    x_axis = new Rickshaw.Graph.Axis.Time(graph: @graph)
    y_axis = new Rickshaw.Graph.Axis.Y(graph: @graph, tickFormat: Rickshaw.Fixtures.Number.formatKMBT)
    @graph.render()

  onData: (data) ->
    if @graph
      @graph.series[0].data = data.points
      @graph.render()
@veetase
Copy link
Author

veetase commented Jun 26, 2015

The line is shown as expected, but hovering on it doesn't show anything.

@gottfrois
Copy link
Owner

I've updated Rickshaw library to the latest version in 2.4.4, can you try it out?

@veetase
Copy link
Author

veetase commented Jul 18, 2015

OK, thanks
2015年7月11日 下午10:22于 "Pierre-Louis Gottfrois" [email protected]写道:

I've updated Rickshaw library to the latest version in 2.4.4, can you try
it out?


Reply to this email directly or view it on GitHub
#77 (comment)
.

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

No branches or pull requests

2 participants