Compare commits

...

10 Commits

12 changed files with 39 additions and 46 deletions

4
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "cmake/backbone"] [submodule "cmake/backbone"]
path = cmake/backbone path = cmake/backbone
url = git@git.backbone.ws:make/cmake-backbone-modules.git url = https://git.backbone.ws/kolan/cmake.backbone.git
[submodule "util/backbone-utils"] [submodule "util/backbone-utils"]
path = util/backbone path = util/backbone
url = git@git.backbone.ws:make/cmake-backbone-utils.git url = https://git.backbone.ws/kolan/cmake.backbone-utils.git

View File

@ -8,13 +8,14 @@ Git: https://git.backbone.ws/gtk/cairo-chart
## View YouTube movie ## View YouTube movie
[![View video](https://img.youtube.com/vi/wmZAw2csjQg/0.jpg)](https://www.youtube.com/watch?v=wmZAw2csjQg) [![View video](https://img.youtube.com/vi/GpnObfofqYI/0.jpg)](https://www.youtube.com/watch?v=GpnObfofqYI)
## Screenshots ## Screenshots
![Screenshot1](https://redmine.backbone.ws/attachments/download/424/20171225_020441.png) ![Screenshot1](https://redmine.backbone.ws/attachments/download/444/20180221_122422.png)
![Screenshot2](https://redmine.backbone.ws/attachments/download/425/20171225_020414.png) ![Screenshot2](https://redmine.backbone.ws/attachments/download/443/20180221_122449.png)
![Screenshot3](https://redmine.backbone.ws/attachments/download/426/20171225_020350.png) ![Screenshot3](https://redmine.backbone.ws/attachments/download/442/20180221_122459.png)
![Screenshot4](https://redmine.backbone.ws/attachments/download/427/20171225_020330.png) ![Screenshot4](https://redmine.backbone.ws/attachments/download/441/20180221_122508.png)
![Screenshot5](https://redmine.backbone.ws/attachments/download/428/20171225_020315.png) ![Screenshot5](https://redmine.backbone.ws/attachments/download/440/20180221_122535.png)
![Screenshot6](https://redmine.backbone.ws/attachments/download/429/20171225_020301.png) ![Screenshot6](https://redmine.backbone.ws/attachments/download/439/20180221_122520.png)
![Screenshot7](https://redmine.backbone.ws/attachments/download/430/20171225_020237.png) ![Screenshot7](https://redmine.backbone.ws/attachments/download/438/20180221_122546.png)
![Screenshot8](https://redmine.backbone.ws/attachments/download/437/20180221_122553.png)

@ -1 +1 @@
Subproject commit 9ba1995060ebb1c65ac9855e3671b3992c859059 Subproject commit 206751e1f4814716d716f6bc297c280d4bf1dcf7

View File

@ -102,7 +102,6 @@ namespace CairoChart {
// TODO: check format // TODO: check format
_format = value; _format = value;
} }
default = "%.2Lf";
} }
/** /**
@ -114,7 +113,6 @@ namespace CairoChart {
// TODO: check format // TODO: check format
_date_format = value; _date_format = value;
} }
default = "%Y.%m.%d";
} }
/** /**
@ -126,7 +124,6 @@ namespace CairoChart {
// TODO: check format // TODO: check format
_time_format = value; _time_format = value;
} }
default = "%H:%M:%S";
} }
/** /**
@ -140,7 +137,6 @@ namespace CairoChart {
// TODO: check format // TODO: check format
_dsec_signs = value; _dsec_signs = value;
} }
default = 2;
} }
/** /**

View File

@ -9,8 +9,7 @@ CONFIGURE_FILE ( "${CMAKE_SOURCE_DIR}/cmake/backbone/templates/library_construct
INCLUDE_DIRECTORIES ("${CMAKE_SOURCE_DIR}/src") INCLUDE_DIRECTORIES ("${CMAKE_SOURCE_DIR}/src")
SET (LibCustomVapis ${CMAKE_SOURCE_DIR}/src/cairo-chart-float128type.vapi) SET (LibCustomVapis ${CMAKE_SOURCE_DIR}/src/cairo-chart-float128type.vapi)
INCLUDE (ValaLibCommonRules) INCLUDE (ValaLibCommonRules)
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart-float128type.h DESTINATION include INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart-float128type-${MAJOR}.h DESTINATION include)
RENAME cairo-chart-float128type-${MAJOR}.h)
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart-float128type.vapi DESTINATION share/vala/vapi INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart-float128type.vapi DESTINATION share/vala/vapi
RENAME cairo-chart-float128type-${MAJOR}.vapi) RENAME cairo-chart-float128type-${MAJOR}.vapi)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart.deps.in CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/cairo-chart.deps.in

View File

@ -96,7 +96,6 @@ namespace CairoChart {
public virtual Color color { public virtual Color color {
protected get { return Color(); } protected get { return Color(); }
set { ctx.set_source_rgba (value.red, value.green, value.blue, value.alpha); } set { ctx.set_source_rgba (value.red, value.green, value.blue, value.alpha); }
default = Color();
} }
/** /**

View File

@ -83,7 +83,7 @@ namespace CairoChart {
*/ */
public Cursors copy () { public Cursors copy () {
var c = new Cursors (chart); var c = new Cursors (chart);
c.list = list.copy(); //c.list = list.copy();
c.active_cursor = active_cursor; c.active_cursor = active_cursor;
c.is_cursor_active = is_cursor_active; c.is_cursor_active = is_cursor_active;
c.style = style; c.style = style;

View File

@ -51,7 +51,6 @@ namespace CairoChart {
set { set {
vspacing = hspacing = value; vspacing = hspacing = value;
} }
default = 2;
} }
/** /**

View File

@ -77,7 +77,6 @@ namespace CairoChart {
axis_x.grid_style.color.green = axis_y.grid_style.color.green = value.green; axis_x.grid_style.color.green = axis_y.grid_style.color.green = value.green;
axis_x.grid_style.color.blue = axis_y.grid_style.color.blue = value.blue; axis_x.grid_style.color.blue = axis_y.grid_style.color.blue = value.blue;
} }
default = Color (0, 0, 0, 1);
} }
/** /**

View File

@ -3,12 +3,12 @@ namespace CairoChart {
/** /**
* 128-bit float type. * 128-bit float type.
*/ */
[CCode (cname = "cairo_chart_float128", has_type_id = false, cheader_filename = "cairo-chart-float128type.h")] [CCode (cname = "cairo_chart_float128", has_type_id = false, cheader_filename = "cairo-chart-float128type-0.h")]
public struct Float128 : double {} public struct Float128 : double {}
/** /**
* Long Double float type. * Long Double float type.
*/ */
[CCode (cname = "cairo_chart_long_double", has_type_id = false, cheader_filename = "cairo-chart-float128type.h")] [CCode (cname = "cairo_chart_long_double", has_type_id = false, cheader_filename = "cairo-chart-float128type-0.h")]
public struct LongDouble : double {} public struct LongDouble : double {}
} }

View File

@ -300,7 +300,7 @@ int main (string[] args) {
var radio_button8 = new RadioButton.with_label_from_widget (radio_button7, "Horizontal Cursors"); var radio_button8 = new RadioButton.with_label_from_widget (radio_button7, "Horizontal Cursors");
button1.clicked.connect (() => { button1.clicked.connect (() => {
chart = chart1; da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); chart = chart1; da.queue_draw();
switch (chart.legend.position) { switch (chart.legend.position) {
case Legend.Position.TOP: radio_button1.set_active(true); break; case Legend.Position.TOP: radio_button1.set_active(true); break;
case Legend.Position.RIGHT: radio_button2.set_active(true); break; case Legend.Position.RIGHT: radio_button2.set_active(true); break;
@ -313,7 +313,7 @@ int main (string[] args) {
} }
}); });
button2.clicked.connect (() => { button2.clicked.connect (() => {
chart = chart2; da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); chart = chart2; da.queue_draw();
switch (chart.legend.position) { switch (chart.legend.position) {
case Legend.Position.TOP: radio_button1.set_active(true); break; case Legend.Position.TOP: radio_button1.set_active(true); break;
case Legend.Position.RIGHT: radio_button2.set_active(true); break; case Legend.Position.RIGHT: radio_button2.set_active(true); break;
@ -326,7 +326,7 @@ int main (string[] args) {
} }
}); });
button3.clicked.connect (() => { button3.clicked.connect (() => {
chart = chart3; da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); chart = chart3; da.queue_draw();
switch (chart.legend.position) { switch (chart.legend.position) {
case Legend.Position.TOP: radio_button1.set_active(true); break; case Legend.Position.TOP: radio_button1.set_active(true); break;
case Legend.Position.RIGHT: radio_button2.set_active(true); break; case Legend.Position.RIGHT: radio_button2.set_active(true); break;
@ -339,7 +339,7 @@ int main (string[] args) {
} }
}); });
button4.clicked.connect (() => { button4.clicked.connect (() => {
chart = chart4; da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); chart = chart4; da.queue_draw();
switch (chart.legend.position) { switch (chart.legend.position) {
case Legend.Position.TOP: radio_button1.set_active(true); break; case Legend.Position.TOP: radio_button1.set_active(true); break;
case Legend.Position.RIGHT: radio_button2.set_active(true); break; case Legend.Position.RIGHT: radio_button2.set_active(true); break;
@ -357,7 +357,7 @@ int main (string[] args) {
s.axis_x.title.text = ""; s.axis_x.title.text = "";
s.axis_y.title.text = ""; s.axis_y.title.text = "";
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
}); });
button6.clicked.connect (() => { button6.clicked.connect (() => {
for (var i = 0; i < chart.series.length; ++i) { for (var i = 0; i < chart.series.length; ++i) {
@ -365,7 +365,7 @@ int main (string[] args) {
s.axis_x.date_format = "%Y.%m.%d"; s.axis_x.date_format = "%Y.%m.%d";
s.axis_x.time_format = ""; s.axis_x.time_format = "";
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
}); });
button7.clicked.connect (() => { button7.clicked.connect (() => {
@ -374,7 +374,7 @@ int main (string[] args) {
s.axis_x.date_format = ""; s.axis_x.date_format = "";
s.axis_x.time_format = "%H:%M:%S"; s.axis_x.time_format = "%H:%M:%S";
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
}); });
button8.clicked.connect (() => { button8.clicked.connect (() => {
@ -383,32 +383,32 @@ int main (string[] args) {
s.axis_x.date_format = "%Y.%m.%d"; s.axis_x.date_format = "%Y.%m.%d";
s.axis_x.time_format = "%H:%M:%S"; s.axis_x.time_format = "%H:%M:%S";
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
}); });
radio_button1.toggled.connect ((button) => { radio_button1.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.legend.position = Legend.Position.TOP; chart.legend.position = Legend.Position.TOP;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
radio_button2.toggled.connect ((button) => { radio_button2.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.legend.position = Legend.Position.RIGHT; chart.legend.position = Legend.Position.RIGHT;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
radio_button3.toggled.connect ((button) => { radio_button3.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.legend.position = Legend.Position.LEFT; chart.legend.position = Legend.Position.LEFT;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
radio_button4.toggled.connect ((button) => { radio_button4.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.legend.position = Legend.Position.BOTTOM; chart.legend.position = Legend.Position.BOTTOM;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
@ -418,26 +418,26 @@ int main (string[] args) {
radio_button5.toggled.connect ((button) => { radio_button5.toggled.connect ((button) => {
// TODO: set labels // TODO: set labels
if (button.get_active()) { if (button.get_active()) {
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
radio_button6.toggled.connect ((button) => { radio_button6.toggled.connect ((button) => {
// TODO: set cursors // TODO: set cursors
if (button.get_active()) { if (button.get_active()) {
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
});*/ });*/
radio_button7.toggled.connect ((button) => { radio_button7.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.cursors.style.orientation = Cursors.Orientation.VERTICAL; chart.cursors.style.orientation = Cursors.Orientation.VERTICAL;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
radio_button8.toggled.connect ((button) => { radio_button8.toggled.connect ((button) => {
if (button.get_active()) { if (button.get_active()) {
chart.cursors.style.orientation = Cursors.Orientation.HORIZONTAL; chart.cursors.style.orientation = Cursors.Orientation.HORIZONTAL;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
} }
}); });
@ -494,7 +494,7 @@ int main (string[] args) {
chart.cursors.set_active (Point(event.x, event.y)); chart.cursors.set_active (Point(event.x, event.y));
mouse_state = MouseState.CURSOR_SELECTION; mouse_state = MouseState.CURSOR_SELECTION;
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
break; break;
case 2: // start zoom area selection case 2: // start zoom area selection
@ -520,7 +520,7 @@ int main (string[] args) {
case 1: // start cursor position selection case 1: // start cursor position selection
if ((event.state & Gdk.ModifierType.SHIFT_MASK) != 0) { // remove cursor if ((event.state & Gdk.ModifierType.SHIFT_MASK) != 0) { // remove cursor
//chart.remove_active (); //chart.remove_active ();
//da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); //da.queue_draw();
//mouse_state = MouseState.FREE; //mouse_state = MouseState.FREE;
} else { // add cursor } else { // add cursor
chart.cursors.add_active (); chart.cursors.add_active ();
@ -535,7 +535,7 @@ int main (string[] args) {
chart.zoom_in (new Area.with_abs(sel_x0, sel_y0, sel_x1, sel_y1)); chart.zoom_in (new Area.with_abs(sel_x0, sel_y0, sel_x1, sel_y1));
else else
chart.zoom_out (); chart.zoom_out ();
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
mouse_state = MouseState.FREE; mouse_state = MouseState.FREE;
break; break;
@ -553,7 +553,7 @@ int main (string[] args) {
case MouseState.DRAW_SELECTION: case MouseState.DRAW_SELECTION:
sel_x1 = event.x; sel_x1 = event.x;
sel_y1 = event.y; sel_y1 = event.y;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
break; break;
case MouseState.MOVING_CHART: case MouseState.MOVING_CHART:
@ -561,12 +561,12 @@ int main (string[] args) {
chart.move (Point(){x = delta_x, y = delta_y}); chart.move (Point(){x = delta_x, y = delta_y});
mov_x0 = event.x; mov_x0 = event.x;
mov_y0 = event.y; mov_y0 = event.y;
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
break; break;
case MouseState.CURSOR_SELECTION: case MouseState.CURSOR_SELECTION:
chart.cursors.set_active (Point(event.x, event.y)); chart.cursors.set_active (Point(event.x, event.y));
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
break; break;
} }
@ -581,7 +581,7 @@ int main (string[] args) {
chart.zoom_scroll_out(Point(event.x, event.y)); chart.zoom_scroll_out(Point(event.x, event.y));
break; break;
} }
da.queue_draw_area(0, 0, da.get_allocated_width(), da.get_allocated_height()); da.queue_draw();
//var ret = chart.scroll_notify_event(event); //var ret = chart.scroll_notify_event(event);
return true; // return ret; return true; // return ret;