projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support mult-data charts and legend.
[pspp-builds.git]
/
src
/
output
/
chart.c
diff --git
a/src/output/chart.c
b/src/output/chart.c
index 9ae12f9c3105c600cea0a2bed692a8dea824908c..e324901cc4df1d445f3fc8c7a4b64296bca55bca 100644
(file)
--- a/
src/output/chart.c
+++ b/
src/output/chart.c
@@
-29,12
+29,12
@@
#include <plot.h>
#include <plot.h>
-#include <libpspp/alloc.h>
#include <libpspp/str.h>
#include <output/manager.h>
#include <output/output.h>
#include "error.h"
#include <libpspp/str.h>
#include <output/manager.h>
#include <output/output.h>
#include "error.h"
+#include "xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-52,6
+52,7
@@
chart_create(void)
return NULL;
chart = xmalloc (sizeof *chart);
return NULL;
chart = xmalloc (sizeof *chart);
+ chart->lp = NULL;
d->class->initialise_chart(d, chart);
if (!chart->lp)
{
d->class->initialise_chart(d, chart);
if (!chart->lp)
{
@@
-82,6
+83,9
@@
chart_create(void)
chart->legend_left = 810;
chart->legend_right = 1000;
chart->font_size = 0;
chart->legend_left = 810;
chart->legend_right = 1000;
chart->font_size = 0;
+ chart->in_path = false;
+ chart->dataset = NULL;
+ chart->n_datasets = 0;
strcpy(chart->fill_colour,"red");
/* Get default font size */
strcpy(chart->fill_colour,"red");
/* Get default font size */
@@
-99,6
+103,7
@@
chart_create(void)
void
chart_submit(struct chart *chart)
{
void
chart_submit(struct chart *chart)
{
+ int i;
struct som_entity s;
struct outp_driver *d;
struct som_entity s;
struct outp_driver *d;
@@
-123,6
+128,11
@@
chart_submit(struct chart *chart)
d = outp_drivers (NULL);
d->class->finalise_chart(d, chart);
d = outp_drivers (NULL);
d->class->finalise_chart(d, chart);
+
+ for (i = 0 ; i < chart->n_datasets; ++i)
+ free (chart->dataset[i]);
+ free (chart->dataset);
+
free(chart);
}
free(chart);
}