better comment
[pspp] / src / output / charts / np-plot-cairo.c
index aa7d6773481a24b40f00cfec396ad669d34675e7..f74572d0c8a57f0f6804e6bab42ca479df67bd53 100644 (file)
 #define _(msgid) gettext (msgid)
 
 static void
-np_plot_chart_draw (const struct chart_item *chart_item, cairo_t *cr,
+np_plot_chart_draw (const struct chart *chart, cairo_t *cr,
                     struct xrchart_geometry *geom)
 {
-  const struct np_plot_chart *npp = to_np_plot_chart (chart_item);
+  const struct np_plot_chart *npp = to_np_plot_chart (chart);
   struct casereader *data;
   struct ccase *c;
 
-  xrchart_write_title (cr, geom, _("Normal Q-Q Plot of %s"), chart_item->title);
+  xrchart_write_title (cr, geom, _("Normal Q-Q Plot of %s"), chart->title);
   xrchart_write_xlabel (cr, geom, _("Observed Value"));
   xrchart_write_ylabel (cr, geom, _("Expected Normal"));
   if (! xrchart_write_xscale (cr, geom,
@@ -48,8 +48,8 @@ np_plot_chart_draw (const struct chart_item *chart_item, cairo_t *cr,
   data = casereader_clone (npp->data);
   for (; (c = casereader_read (data)) != NULL; case_unref (c))
     xrchart_datum (cr, geom, 0,
-                 case_data_idx (c, NP_IDX_Y)->f,
-                 case_data_idx (c, NP_IDX_NS)->f);
+                   case_num_idx (c, NP_IDX_Y),
+                   case_num_idx (c, NP_IDX_NS));
   casereader_destroy (data);
 
   xrchart_line (cr, geom, npp->slope, npp->intercept,
@@ -57,14 +57,14 @@ np_plot_chart_draw (const struct chart_item *chart_item, cairo_t *cr,
 }
 
 static void
-dnp_plot_chart_draw (const struct chart_item *chart_item, cairo_t *cr,
+dnp_plot_chart_draw (const struct chart *chart, cairo_t *cr,
                      struct xrchart_geometry *geom)
 {
-  const struct np_plot_chart *dnpp = to_np_plot_chart (chart_item);
+  const struct np_plot_chart *dnpp = to_np_plot_chart (chart);
   struct casereader *data;
   struct ccase *c;
 
-  xrchart_write_title (cr, geom, _("Detrended Normal Q-Q Plot of %s"), chart_item->title);
+  xrchart_write_title (cr, geom, _("Detrended Normal Q-Q Plot of %s"), chart->title);
   xrchart_write_xlabel (cr, geom, _("Observed Value"));
   xrchart_write_ylabel (cr, geom, _("Dev from Normal"));
   if (! xrchart_write_xscale (cr, geom, dnpp->y_min, dnpp->y_max))
@@ -74,21 +74,21 @@ dnp_plot_chart_draw (const struct chart_item *chart_item, cairo_t *cr,
 
   data = casereader_clone (dnpp->data);
   for (; (c = casereader_read (data)) != NULL; case_unref (c))
-    xrchart_datum (cr, geom, 0, case_data_idx (c, NP_IDX_Y)->f,
-                   case_data_idx (c, NP_IDX_DNS)->f);
+    xrchart_datum (cr, geom, 0, case_num_idx (c, NP_IDX_Y),
+                   case_num_idx (c, NP_IDX_DNS));
   casereader_destroy (data);
 
   xrchart_line (cr, geom, 0, 0, dnpp->y_min, dnpp->y_max, XRCHART_DIM_X);
 }
 
 void
-xrchart_draw_np_plot (const struct chart_item *chart_item, cairo_t *cr,
+xrchart_draw_np_plot (const struct chart *chart, cairo_t *cr,
                       struct xrchart_geometry *geom)
 {
-  const struct np_plot_chart *npp = to_np_plot_chart (chart_item);
+  const struct np_plot_chart *npp = to_np_plot_chart (chart);
 
   if (npp->detrended)
-    dnp_plot_chart_draw (chart_item, cr, geom);
+    dnp_plot_chart_draw (chart, cr, geom);
   else
-    np_plot_chart_draw (chart_item, cr, geom);
+    np_plot_chart_draw (chart, cr, geom);
 }