INNER CODE UNIT · C

x_scale

lxi-tools/lxi-tools · src/gtkchart.c:345

    float x_scale = (w - 2 * 0.1 * w) / self->x_max;
    float y_scale = (h - 2 * 0.2 * h) / self->y_max;

    // Draw data points from list
    GSList *l;
    for (l = self->point_list; l != NULL; l = l->next)
    {
        struct chart_point_t *point = l->data;

        switch (self->type)
        {
            case GTK_CHART_TYPE_LINE:
                if (l == self->point_list)
                {
                    // Move to first point
                    cairo_move_to(cr, point->x * x_scale, point->y * y_scale);
                }
                else

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…