use smaller font for legend.
This commit is contained in:
@@ -210,7 +210,8 @@
|
||||
GWEN_Date_GetYear(dt), \n
|
||||
GWEN_Date_GetMonth(dt), \n
|
||||
GWEN_Date_GetDay(dt)); \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
if (!$(struct_prefix)_HasTickValue(st, v)) \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
GWEN_Buffer_Reset(dbuf); \n
|
||||
} \n
|
||||
GWEN_Date_AddDays(dt, 1); \n
|
||||
@@ -241,30 +242,31 @@
|
||||
GWEN_DATE *dt; \n
|
||||
\n
|
||||
maxValue=st->maxValue; \n
|
||||
dt=GWEN_Date_fromLocalTime(maxValue); \n
|
||||
GWEN_Date_free(dt); \n
|
||||
\n
|
||||
minValue=st->minValue; \n
|
||||
dt=GWEN_Date_fromLocalTime(minValue); \n
|
||||
if (dt) { \n
|
||||
GWEN_DATE *dtWeekStart; \n
|
||||
\n
|
||||
dtWeekStart=GWEN_Date_GetThisWeekStartFromMonday(dt); \n
|
||||
GWEN_Date_free(dt); \n
|
||||
dt=dtWeekStart; \n
|
||||
} \n
|
||||
\n
|
||||
dbuf=GWEN_Buffer_new(0, 256, 0, 1); \n
|
||||
while(1) { \n
|
||||
double v; \n
|
||||
GWEN_DATE *dtCurrent; \n
|
||||
\n
|
||||
dtCurrent=GWEN_Date_GetThisWeekStartFromMonday(dt); \n
|
||||
v=GWEN_Date_toLocalTime(dtCurrent); \n
|
||||
v=GWEN_Date_toLocalTime(dt); \n
|
||||
if (v>=minValue && v<maxValue) { \n
|
||||
GWEN_Buffer_AppendArgs(dbuf, \n
|
||||
"%04d/%02d/%02d", \n
|
||||
GWEN_Date_GetYear(dtCurrent), \n
|
||||
GWEN_Date_GetMonth(dtCurrent), \n
|
||||
GWEN_Date_GetDay(dtCurrent)); \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
GWEN_Date_GetYear(dt), \n
|
||||
GWEN_Date_GetMonth(dt), \n
|
||||
GWEN_Date_GetDay(dt)); \n
|
||||
if (!$(struct_prefix)_HasTickValue(st, v)) \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
GWEN_Buffer_Reset(dbuf); \n
|
||||
} \n
|
||||
GWEN_Date_free(dt); \n
|
||||
dt=dtCurrent; \n
|
||||
GWEN_Date_AddDays(dt, 7); \n
|
||||
if (v>=maxValue) \n
|
||||
break; \n
|
||||
@@ -297,6 +299,13 @@
|
||||
\n
|
||||
minValue=st->minValue; \n
|
||||
dt=GWEN_Date_fromLocalTime(minValue); \n
|
||||
if (dt) { \n
|
||||
GWEN_DATE *dtMonthStart; \n
|
||||
\n
|
||||
dtMonthStart=GWEN_Date_GetThisMonthStart(dt); \n
|
||||
GWEN_Date_free(dt); \n
|
||||
dt=dtMonthStart; \n
|
||||
} \n
|
||||
\n
|
||||
dbuf=GWEN_Buffer_new(0, 256, 0, 1); \n
|
||||
while(1) { \n
|
||||
@@ -310,7 +319,8 @@
|
||||
"%04d/%02d", \n
|
||||
GWEN_Date_GetYear(dtCurrent), \n
|
||||
GWEN_Date_GetMonth(dtCurrent)); \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
if (!$(struct_prefix)_HasTickValue(st, v)) \n
|
||||
$(struct_prefix)_AddNewTick(st, GWEN_Buffer_GetStart(dbuf), v, lvl, 0); \n
|
||||
GWEN_Buffer_Reset(dbuf); \n
|
||||
} \n
|
||||
GWEN_Date_free(dt); \n
|
||||
|
||||
@@ -127,7 +127,7 @@ void _setupTicksForTimeAxis(AQDG_GRAPH_AXIS *axis)
|
||||
minValue=AQDG_Graph_Axis_GetMinValue(axis);
|
||||
maxValue=AQDG_Graph_Axis_GetMaxValue(axis);
|
||||
diffInDays=(maxValue-minValue)/(24*60*60);
|
||||
DBG_INFO(AQDG_LOGDOMAIN, "Difference in days: %f.0", diffInDays);
|
||||
DBG_ERROR(AQDG_LOGDOMAIN, "Difference in days: %f.0", diffInDays);
|
||||
if (diffInDays<3) {
|
||||
AQDG_Graph_Axis_GenHourTicks(axis, 0, 1);
|
||||
}
|
||||
|
||||
@@ -549,6 +549,7 @@ void AQDG_GraphWidget_SetupDefaultFonts(AQDG_OBJECT *o)
|
||||
MKNORMALFONT(AQDG_GRAPHWIDGET_FONT_IDX_AXISLABEL, 12);
|
||||
MKNORMALFONT(AQDG_GRAPHWIDGET_FONT_IDX_TICKLABELMAINLEVEL, 12);
|
||||
MKNORMALFONT(AQDG_GRAPHWIDGET_FONT_IDX_TICKLABELSUBLEVEL, 10);
|
||||
MKNORMALFONT(AQDG_GRAPHWIDGET_FONT_IDX_LEGEND, 10);
|
||||
|
||||
#undef MKNORMALFONT
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ enum {
|
||||
AQDG_GRAPHWIDGET_FONT_IDX_AXISLABEL,
|
||||
AQDG_GRAPHWIDGET_FONT_IDX_TICKLABELMAINLEVEL,
|
||||
AQDG_GRAPHWIDGET_FONT_IDX_TICKLABELSUBLEVEL,
|
||||
AQDG_GRAPHWIDGET_FONT_IDX_LEGEND,
|
||||
|
||||
AQDG_GRAPHWIDGET_FONT_IDX_LAST
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ AQDG_OBJECT *AQDG_LegendWidget_new(AQDG_OBJECT *parent, uint32_t options, AQDG_O
|
||||
xo->graphWidget=graphWidget;
|
||||
|
||||
AQDG_Object_SetVSpacing(o, 1);
|
||||
AQDG_Object_SetHSpacing(o, 1);
|
||||
AQDG_Object_SetHSpacing(o, 4);
|
||||
_setupWidget(o, xo);
|
||||
|
||||
return o;
|
||||
@@ -80,7 +80,7 @@ void _setupWidget(AQDG_OBJECT *o, AQDG_WIDGET_LEGEND *xo)
|
||||
int penIdx=AQDG_GRAPHWIDGET_PEN_IDX_CURVE0;
|
||||
|
||||
dc=AQDG_DrawableWidget_GetDrawContext(o);
|
||||
AQDG_DrawableWidget_SetFontId(o, AQDG_GraphWidget_GetFont(xo->graphWidget, AQDG_GRAPHWIDGET_FONT_IDX_SUBTITLE));
|
||||
AQDG_DrawableWidget_SetFontId(o, AQDG_GraphWidget_GetFont(xo->graphWidget, AQDG_GRAPHWIDGET_FONT_IDX_LEGEND));
|
||||
|
||||
AQDG_DrawableWidget_new(o, 0, dc);
|
||||
AQDG_LabelWidget_new(o, 0, dc, "Cur:");
|
||||
|
||||
Reference in New Issue
Block a user