Skip to content

Commit

Permalink
Serie line configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lcallarec committed Nov 3, 2020
1 parent 985419d commit f6fcd8c
Show file tree
Hide file tree
Showing 43 changed files with 221 additions and 108 deletions.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# 1.7.1
# 1.8.0-b

## API

* Add a [serie.line](https://lcallarec.github.io/live-chart/Livechart/LiveChart.Serie.line.html) property to configure line / outline looks : width, color, dashes and visibility. For series with area, this impact only the outline, not the area itself.

# 1.7.1

* Add a [serie.add_with_timestamp(double value, int64 timestamp)](https://lcallarec.github.io/live-chart/Livechart/LiveChart.Serie.add_with_timestamp.html) method when you need to add a value with a manually defined timstamp, in milliseconds

* [Serie.set_main_color](https://lcallarec.github.io/live-chart/Livechart/LiveChart.Serie.set_main_color.html) and [Serie.get_main_color](https://lcallarec.github.io/live-chart/Livechart/LiveChart.Serie.get_main_color.html) methods are now deprecated and will be removed in `LiveChart 2`. Use [serie.main_color](https://lcallarec.github.io/live-chart/Livechart/LiveChart.Serie.main_color.html) property instead.
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,35 @@ serie.add(19.5);
serie.add_with_timestamp(19.5, 15978984664);
```

#### Name mutator / accessor property
#### Name

```vala
serie.name = "Temperature in Paris (%s)".printf(last_value);
```

#### Visibility mutator / accessor property
#### Visibility

You can programmatically hide / display series :
You can programmatically hide / display the whole series :

```vala
serie.visible = true;//or false
```

#### Main color mutator / accessor property
#### Lines and outlines

Lines ansd outlines (for bar series) can be configured with `Serie.line` property. Full configuration details available in [Path]((https://lcallarec.github.io/live-chart/Livechart/LiveChart.Path.html) class.

```vala
serie.main_color = { 0.0, 0.1, 0.8, 1.0};
serie.main_color;
serie.line.color = { 0.0, 0.1, 0.8, 1.0};
serie.line.width = 2;
serie.line.dash = Dash() {dashes = [0, 1], offset = 2};
serie.lien.visibility = false;//or true
```

Where color is a [`Gdk.RGBA`](https://valadoc.org/gdk-3.0/Gdk.RGBA.html) struct.
About color : [`Gdk.RGBA`](https://valadoc.org/gdk-3.0/Gdk.RGBA.html) struct.
Dashes : please refer to [valadoc](https://valadoc.org/cairo/Cairo.Context.set_dash.html) and [cairo c documentation](https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-dash)

Please note that this is a conveniant method to underlying `Renderer.main_color` property. Accessing `Renderer` directly offers more specific display options, according to `Renderer` implementation.
For series with area, this impact only the outline, not the area itself.

#### Clear underlying data

Expand Down
4 changes: 2 additions & 2 deletions docs/Livechart/LiveChart.Bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ <h3 class="main_title">Inherited Members:</h3>
<ul class="navi_inline">
<li class="method"><a href="LiveChart.DrawableSerie.get_values.html">get_values</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.is_out_of_area.html">is_out_of_area</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
</ul>
</div>
<div class="column">
<ul class="navi_inline">
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="field"><a href="LiveChart.DrawableSerie.values.html">values</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.DrawableSerie.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method">DrawableSerie</li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.bounding_box.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method">debug</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.draw.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.get_values.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
6 changes: 3 additions & 3 deletions docs/Livechart/LiveChart.DrawableSerie.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down Expand Up @@ -83,11 +83,11 @@ <h2 class="main_title">Description:</h2>
<h2 class="main_title">Content:</h2>
<h3 class="main_title">Properties:</h3>
<ul class="navi_inline">
<li class="property"><span class="leaf_code_definition"><span class="main_keyword">public</span> <span class="main_type"><span class="struct">RGBA</span></span> <b><a href="LiveChart.DrawableSerie.main_color.html" class="property">main_color</a></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
<li class="property"><span class="leaf_code_definition"><span class="main_keyword">public</span> <span class="main_type"><a href="LiveChart.Path.html" class="class">Path</a></span> <b><a href="LiveChart.DrawableSerie.line.html" class="property">line</a></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
</span>
<div class="leaf_brief_description">
</div></li>
<li class="property"><span class="leaf_code_definition"><span class="main_keyword">public</span> <span class="main_basic_type"><span class="struct">double</span></span> <b><a href="LiveChart.DrawableSerie.outline_width.html" class="property">outline_width</a></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
<li class="property"><span class="leaf_code_definition"><span class="main_keyword">public</span> <span class="main_type"><span class="struct">RGBA</span></span> <b><a href="LiveChart.DrawableSerie.main_color.html" class="property">main_color</a></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
</span>
<div class="leaf_brief_description">
</div></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.is_out_of_area.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta charset="UTF-8"/>
<title>LiveChart.DrawableSerie.outline_width &ndash; Livechart &ndash; Vala Binding Reference</title>
<title>LiveChart.DrawableSerie.line &ndash; Livechart &ndash; Vala Binding Reference</title>
<link href="../style.css" rel="stylesheet" type="text/css"/><script src="../scripts.js" type="text/javascript">
</script>
</head>
<body>
<div class="site_header">LiveChart.DrawableSerie.outline_width &ndash; Livechart Reference Manual</div>
<div class="site_header">LiveChart.DrawableSerie.line &ndash; Livechart Reference Manual</div>
<div class="site_body">
<div class="site_navigation">
<ul class="navi_main">
Expand All @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property">line</li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property">outline_width</li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand All @@ -41,10 +41,10 @@
</ul>
</div>
<div class="site_content">
<h1 class="main_title">outline_width</h1>
<h1 class="main_title">line</h1>
<hr class="main_hr"/>
<h2 class="main_title">Description:</h2>
<div class="main_code_definition"><span class="main_keyword">public</span> <span class="main_basic_type"><span class="struct">double</span></span> <b><span class="property">outline_width</span></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
<div class="main_code_definition"><span class="main_keyword">public</span> <span class="main_type"><a href="LiveChart.Path.html" class="class">Path</a></span> <b><span class="property">line</span></b> { <span class="main_keyword">get</span>; <span class="main_keyword">set</span>; }
</div>
</div>
</div><br/>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.main_color.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property">main_color</li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.values.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.DrawableSerie.visible.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ul>
<hr class="navi_hr"/>
<ul class="navi_main">
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property">visible</li>
<li class="creation_method"><a href="LiveChart.DrawableSerie.DrawableSerie.html">DrawableSerie</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.debug.html">debug</a></li>
Expand Down
4 changes: 2 additions & 2 deletions docs/Livechart/LiveChart.Line.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ <h3 class="main_title">Inherited Members:</h3>
<ul class="navi_inline">
<li class="method"><a href="LiveChart.DrawableSerie.get_values.html">get_values</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.is_out_of_area.html">is_out_of_area</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
</ul>
</div>
<div class="column">
<ul class="navi_inline">
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="field"><a href="LiveChart.DrawableSerie.values.html">values</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions docs/Livechart/LiveChart.LineArea.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ <h3 class="main_title">Inherited Members:</h3>
<ul class="navi_inline">
<li class="method"><a href="LiveChart.DrawableSerie.get_values.html">get_values</a></li>
<li class="method"><a href="LiveChart.DrawableSerie.is_out_of_area.html">is_out_of_area</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.line.html">line</a></li>
</ul>
</div>
<div class="column">
<ul class="navi_inline">
<li class="property"><a href="LiveChart.DrawableSerie.outline_width.html">outline_width</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.main_color.html">main_color</a></li>
<li class="field"><a href="LiveChart.DrawableSerie.values.html">values</a></li>
<li class="property"><a href="LiveChart.DrawableSerie.visible.html">visible</a></li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion docs/Livechart/LiveChart.Path.Path.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<h1 class="main_title">Path</h1>
<hr class="main_hr"/>
<h2 class="main_title">Description:</h2>
<div class="main_code_definition"><span class="main_keyword">public</span> <b><span class="creation_method">Path</span></b> ()</div>
<div class="main_code_definition"><span class="main_keyword">public</span> <b><span class="creation_method">Path</span></b> (<span class="main_basic_type"><span class="struct">double</span></span> width = <span class="main_literal">0.5</span>, <span class="main_type"><span class="struct">RGBA</span></span> color = {<span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>}, <span class="main_basic_type"><span class="struct">bool</span></span> visible = <span class="main_literal">true</span>, <span class="main_type"><a href="LiveChart.Dash.html" class="struct">Dash</a></span>? dash = <span class="main_literal">null</span>)
</div>
</div>
</div><br/>
<div class="site_footer">Generated by <a href="https://wiki.gnome.org/Projects/Valadoc"><kbd>valadoc</kbd></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/Livechart/LiveChart.Path.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h3 class="main_title">Properties:</h3>
</ul>
<h3 class="main_title">Creation methods:</h3>
<ul class="navi_inline">
<li class="creation_method"><span class="leaf_code_definition"><span class="main_keyword">public</span> <b><a href="LiveChart.Path.Path.html" class="creation_method">Path</a></b> ()
<li class="creation_method"><span class="leaf_code_definition"><span class="main_keyword">public</span> <b><a href="LiveChart.Path.Path.html" class="creation_method">Path</a></b> (<span class="main_basic_type"><span class="struct">double</span></span> width = <span class="main_literal">0.5</span>, <span class="main_type"><span class="struct">RGBA</span></span> color = {<span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>, <span class="main_literal">1.0</span>}, <span class="main_basic_type"><span class="struct">bool</span></span> visible = <span class="main_literal">true</span>, <span class="main_type"><a href="LiveChart.Dash.html" class="struct">Dash</a></span>? dash = <span class="main_literal">null</span>)
</span>
<div class="leaf_brief_description">
</div></li>
Expand Down
Loading

0 comments on commit f6fcd8c

Please sign in to comment.