output: Use Cairo and Pango to draw charts, instead of libplot.
[pspp-builds.git] / src / output / html.c
index 8c1a653017273921fde64e07b685178a7f4f6bbd..3a8be8eb0b0e2cbf8db200b73bf5099244f5c2c3 100644 (file)
@@ -138,14 +138,6 @@ html_close_driver (struct outp_driver *this)
   return ok;
 }
 
-/* Link the image contained in FILE_NAME to the
-   HTML stream in FILE. */
-static void
-link_image (FILE *file, char *file_name)
-{
-  fprintf (file, "<IMG SRC=\"%s\"/>", file_name);
- }
-
 /* Generic option types. */
 enum
   {
@@ -209,18 +201,9 @@ html_output_chart (struct outp_driver *this, const struct chart *chart)
 {
   struct html_driver_ext *x = this->ext;
   char *file_name;
-  plPlotter *lp;
-
-  /* Draw chart in separate file. */
-  if (!chart_create_file ("png", x->chart_file_name, x->chart_cnt,
-                          NULL, &file_name, &lp))
-    return;
-  x->chart_cnt++;
-  chart_draw (chart, lp);
-  pl_deletepl_r (lp);
-
-  link_image (x->file, file_name);
 
+  file_name = chart_draw_png (chart, x->chart_file_name, x->chart_cnt++);
+  fprintf (x->file, "<IMG SRC=\"%s\"/>", file_name);
   free (file_name);
 }