Comments (11)
Opened #12, I close this one, the main issue about hiding chart parts and grid configuration has been resolved.
from live-chart.
Looks like good improvements. I'll work on it soon.
However, I'm not sure what do you meant by "chart border". Is it to mimic the grey border and margin of the panel of opened files above button line in your screenshot ?
from live-chart.
Working on it. It'll be ready soon.
from live-chart.
In release 1.3.0 :
- Legend can de hidden
- Labels can de hidden
- Guidelines can be hidden
- Custom width, color and dash style on guidelines
- Axis can be hidden or customized (width, color and dash style)
Documentation has been updated to reflect the changes. Please let me know if it's clear enough or if the documentation needs to be rewritten.
from live-chart.
There's nothing wrong, as long as it fits your needs :)
So, right now, the solution will be to
- clear the underlying
Values
object of a serie renderer - manually compute back, for each point, the related timestamp (2s behind now for each measure in your case)
var renderer = new LiveChart.SmoothLineArea();
var cpu = new LiveChart.Serie("CPU", renderer);
var chart = new LiveChart.Chart();
chart.add_serie(cpu);
//Other stuff
//To add the CPU history
var values = renderer.get_values();
values.clear(); // Clear all the data
//Here's your own data from ArrayList<double>
var cpu_history = new Gee.ArrayList<double?>();
cpu_history.add(10);
cpu_history.add(30);
cpu_history.add(20);
cpu_history.add(40);
cpu_history.add(20);
cpu_history.add(60);
cpu_history.add(30);
cpu_history.add(90);
var refresh_rate_is_ms = 2000; //your own refresh rate in milliseconds
var now = GLib.get_real_time() / 1000; //now in milliseconds
//the timestamp of the first point
//we are considering that it is "now", but because of your data structure
//it can be between now and now - 2secs), we can't guess
var ts = now - (cpu_history.size * refresh_rate_is_ms);
cpu_history.foreach((value) => {
values.add({ts, value});
ts += refresh_rate_is_ms;
return true;
});
By the way, I also need such feature, so I will add some convenient methods to help dealing with the underlying Values
object.
But if you don't store a timestamp alongside your data, you'll need to guess them with extra code, and by "guess" I mean that your data points time precision will not be guaranteed (epsilon = 2000ms in your case).
Maybe I could add conversion methods between timestamp unaware collection and TimestampedValue
in LiveChart library ; let me think if it makes sense.
from live-chart.
Works like a charm
Built in conversion to a TimestampedValue
would be awesome
.
from live-chart.
from live-chart.
Also would be nice to control:
- grid colour
- grid lines (only vertical or horizontal)
- grid line style (solid, dotted, dashed)
- grid line weight
Sorry that's a lot
from live-chart.
Wondering how to easily clear a serie
e.g.:
- clicking new process to load new buffer which contains CPU usage history
- previous buffer is cleared
- adding new buffer (I'm saving data in ArrayList) (should I do
foreach
here?)
What do You recommend?
from live-chart.
Hmmm, just a question. You are storing CPU usage history in an ArrayList, but are you storing values and related timestamps ?
from live-chart.
I'm not storing them, because chart is in the representative layer and process cpu history is in lower layer of model-controller. Every 2s I'm updating ArrayLists of all processes. And I thought maybe there is possibility to push ArrayList to chart to instantly draw a chart. And after this to draw it normally, adding points in periods of time. I don't know, maybe my way of thinking on this is wrong.
from live-chart.
Related Issues (20)
- Convert method between timestamp unaware collection and TimestampedValue HOT 3
- Create NEWS.md HOT 1
- Allow to access to added series HOT 4
- Allow to add_unaware_timestamp_collection by serie number HOT 3
- Crushes if there is no value added instatly HOT 3
- Allow to clear serie by index HOT 7
- Allow to change colour of serie by index HOT 4
- Could support to show static chart with static data? HOT 4
- Some ideas to improve live-chart HOT 6
- Can't build it HOT 2
- The name `main_color' does not exist in the context of `LiveChart.Drawable' HOT 2
- Porting to pure C HOT 7
- Round corners HOT 9
- Tests require a graphical session HOT 1
- Add native support for stacked charts HOT 1
- Add multicolor feature to line and area HOT 17
- Showing minus value HOT 3
- Allow to set custom Area color
- Usage explanation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-chart.