BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
54f55199
Commit
54f55199
authored
Sep 28, 2016
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor chart changes
parent
d175edeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
21 deletions
+10
-21
lv_chart.c
lv_objx/lv_chart.c
+5
-12
lv_chart.h
lv_objx/lv_chart.h
+5
-9
No files found.
lv_objx/lv_chart.c
View file @
54f55199
...
...
@@ -15,8 +15,6 @@
/*********************
* DEFINES
*********************/
#define LV_CHART_XMIN_DEF 0
#define LV_CHART_XMAX_DEF 100
#define LV_CHART_YMIN_DEF 0
#define LV_CHART_YMAX_DEF 100
#define LV_CHART_HDIV_DEF 3
...
...
@@ -109,14 +107,13 @@ lv_obj_t* lv_chart_create(lv_obj_t* par_dp, lv_obj_t * copy_dp)
ll_init
(
&
ext_dp
->
dl_ll
,
sizeof
(
cord_t
*
));
ext_dp
->
dl_num
=
0
;
lv_obj_set_signal_f
(
new_obj_dp
,
lv_chart_signal
);
lv_obj_set_design_f
(
new_obj_dp
,
lv_chart_design
);
/*Init the new chart background object*/
if
(
copy_dp
==
NULL
)
{
ext_dp
->
type
=
LV_CHART_
COL
;
ext_dp
->
type
=
LV_CHART_
LINE
;
lv_obj_set_style
(
new_obj_dp
,
&
lv_charts_def
);
lv_obj_set_signal_f
(
new_obj_dp
,
lv_chart_signal
);
lv_obj_set_design_f
(
new_obj_dp
,
lv_chart_design
);
ext_dp
->
xmin
=
LV_CHART_XMIN_DEF
;
ext_dp
->
xmax
=
LV_CHART_XMAX_DEF
;
ext_dp
->
ymin
=
LV_CHART_YMIN_DEF
;
ext_dp
->
ymax
=
LV_CHART_YMAX_DEF
;
ext_dp
->
hdiv_num
=
LV_CHART_HDIV_DEF
;
...
...
@@ -125,8 +122,6 @@ lv_obj_t* lv_chart_create(lv_obj_t* par_dp, lv_obj_t * copy_dp)
}
else
{
lv_chart_ext_t
*
ext_copy_dp
=
lv_obj_get_ext
(
copy_dp
);
ext_dp
->
type
=
ext_copy_dp
->
type
;
ext_dp
->
xmin
=
ext_copy_dp
->
xmin
;
ext_dp
->
xmax
=
ext_copy_dp
->
xmax
;
ext_dp
->
ymin
=
ext_copy_dp
->
ymin
;
ext_dp
->
ymax
=
ext_copy_dp
->
ymax
;
ext_dp
->
hdiv_num
=
ext_copy_dp
->
hdiv_num
;
...
...
@@ -230,12 +225,10 @@ void lv_chart_set_hvdiv(lv_obj_t * obj_dp, uint8_t hdiv, uint8_t vdiv)
* @param ymin y minimum value
* @param ymax y maximum value
*/
void
lv_chart_set_range
(
lv_obj_t
*
obj_dp
,
int32_t
xmin
,
int32_t
xmax
,
int32_t
ymin
,
int32
_t
ymax
)
void
lv_chart_set_range
(
lv_obj_t
*
obj_dp
,
cord_t
ymin
,
cord
_t
ymax
)
{
lv_chart_ext_t
*
ext_dp
=
lv_obj_get_ext
(
obj_dp
);
ext_dp
->
xmin
=
xmin
;
ext_dp
->
xmax
=
xmax
;
ext_dp
->
ymin
=
ymin
;
ext_dp
->
ymax
=
ymax
;
...
...
lv_objx/lv_chart.h
View file @
54f55199
...
...
@@ -32,8 +32,6 @@ typedef enum
LV_CHART_POINT
,
}
lv_chart_type_t
;
typedef
cord_t
lv_chart_range_t
;
/*Style of chart background*/
typedef
struct
{
...
...
@@ -41,9 +39,9 @@ typedef struct
lv_lines_t
div_lines
;
uint8_t
div_line_opa
;
/*Percentage of obj. opacity*/
color_t
color
[
LV_CHART_DL_NUM
];
/*Line/Point/Col color */
uint16_t
width
;
/*Line width or point
diameter
*/
uint16_t
width
;
/*Line width or point
radius
*/
opa_t
data_opa
;
/*Line/Point/Col opacity in the percentage of obj. opacity*/
uint8_t
dark_eff
;
/*Dark effect on the bottom of points and columns*/
uint8_t
dark_eff
;
/*Dark effect on the bottom of
ó
points and columns*/
}
lv_charts_t
;
/*Built-in styles of chart background*/
...
...
@@ -56,10 +54,8 @@ typedef enum
typedef
struct
{
lv_rect_ext_t
rect_ext
;
lv_chart_range_t
xmin
;
lv_chart_range_t
xmax
;
lv_chart_range_t
ymin
;
lv_chart_range_t
ymax
;
cord_t
ymin
;
cord_t
ymax
;
uint8_t
hdiv_num
;
uint8_t
vdiv_num
;
...
...
@@ -82,7 +78,7 @@ void lv_chart_refr(lv_obj_t * obj_dp);
void
lv_chart_set_type
(
lv_obj_t
*
obj_dp
,
lv_chart_type_t
type
);
void
lv_chart_set_hvdiv
(
lv_obj_t
*
obj_dp
,
uint8_t
hdiv
,
uint8_t
vdiv
);
void
lv_chart_set_range
(
lv_obj_t
*
obj_dp
,
int32_t
xmin
,
int32_t
xmax
,
int32_t
ymin
,
int32
_t
ymax
);
void
lv_chart_set_range
(
lv_obj_t
*
obj_dp
,
cord_t
ymin
,
cord
_t
ymax
);
void
lv_chart_set_pnum
(
lv_obj_t
*
obj_dp
,
uint16_t
pnum
);
void
lv_chart_set_next
(
lv_obj_t
*
obj_dp
,
cord_t
*
dl_p
,
cord_t
y
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment