epochjs / epoch

A general purpose, real-time visualization library.
http://epochjs.github.io/epoch
MIT License
4.97k stars 278 forks source link

Top of the realtime line graph has been cut. #211

Closed redbox-cdn closed 6 months ago

redbox-cdn commented 8 years ago

The realtime Line graph sometimes not show the top of graph.

Here is the SS. ss

What should I modify the css or html..

My code is here.

<div id="test" class="epoch category20" style="width: 400px; height: 200px;"></div>

idx = ((new Date()).getTime()/1000)|0;
var request = [
  { label: 'Series 1', values: [ {time: idx, y: 0}] }
];

var request1 = $('#test').epoch({
    type: 'time.line',
    data: request,
    ticks: { time: 10, right: 6, left: 6 },                  
    fps: 30,
    margins: { top: 20, right: 70, bottom: 20, left: 70 },
    axes: ['right', 'bottom']
});
request = [{time: time, y: request}];
request1.push(request);

Thanks!

rsandor commented 8 years ago

Hm, this is strange. I will look into asap and get back to you. Cheers!

redbox-cdn commented 8 years ago

Hi

It seems that this problem is related to scale unit.

If the values of data between 10 and 99, it's no problem. But If the value of data between 9 and 11 (also 99 and 100) ,this graph is strange.

So I am consider changed into decimal point the scale unit. ss2

segphault commented 8 years ago

Any word on this? I'm encountering a similar issue in my project. The lines at the top and bottom of the graph are thinner, as though partially truncated.

rsandor commented 8 years ago

@segphault - haven't had the chance to look at it. If it's causing a problem my bet would be it's the CSS cutting off the top. Mind looking into it?

segphault commented 8 years ago

yeah, I'll see what I can figure out. It doesn't appear to be a CSS issue, the line runs all the way to the edge of the canvas element and the behavior doesn't appear to change when I set margins. I'm going to experiment with the code that computes the canvas size and see if that sheds any light.

rsandor commented 8 years ago

Thanks so much!