/[pspp]/pspp/src/plot-chart.c
ViewVC logotype

Diff of /pspp/src/plot-chart.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by jmd, Fri Apr 29 01:02:15 2005 UTC revision 1.6 by blp, Mon Jun 13 06:51:13 2005 UTC
# Line 52  struct chart * Line 52  struct chart *
52  chart_create(void)  chart_create(void)
53  {  {
54    struct chart *chart;    struct chart *chart;
   
55    struct outp_driver *d;    struct outp_driver *d;
56    
57      d = outp_drivers (NULL);
58      if (d == NULL)
59        return NULL;
60      
61    chart = xmalloc(sizeof(struct chart) );    chart = xmalloc(sizeof(struct chart) );
62      d->class->initialise_chart(d, chart);
63    for (d = outp_drivers (NULL); d; d = outp_drivers (d))    if (!chart->lp)
64      {      {
65        assert(d->class->initialise_chart);        free (chart);
66        d->class->initialise_chart(d, chart);        return NULL;
       break; /* KLUDGE!! */  
67      }      }
68    
   if ( ! chart->lp )  
     return 0;  
   
69    if (pl_openpl_r (chart->lp) < 0)      /* open Plotter */    if (pl_openpl_r (chart->lp) < 0)      /* open Plotter */
70        return 0;      return NULL;
71      
72    pl_fspace_r (chart->lp, 0.0, 0.0, 1000.0, 1000.0); /* set coordinate system */    pl_fspace_r (chart->lp, 0.0, 0.0, 1000.0, 1000.0); /* set coordinate system */
73    pl_flinewidth_r (chart->lp, 0.25);    /* set line thickness */    pl_flinewidth_r (chart->lp, 0.25);    /* set line thickness */
74    pl_pencolorname_r (chart->lp, "black");    pl_pencolorname_r (chart->lp, "black");
# Line 77  chart_create(void) Line 76  chart_create(void)
76    pl_erase_r (chart->lp);               /* erase graphics display */    pl_erase_r (chart->lp);               /* erase graphics display */
77    pl_filltype_r(chart->lp,0);    pl_filltype_r(chart->lp,0);
78    
   
   
79    pl_savestate_r(chart->lp);    pl_savestate_r(chart->lp);
80    
81    /* Set default chartetry */    /* Set default chartetry */
# Line 94  chart_create(void) Line 91  chart_create(void)
91    chart->font_size = 0;    chart->font_size = 0;
92    strcpy(chart->fill_colour,"red");    strcpy(chart->fill_colour,"red");
93    
   
94    /* Get default font size */    /* Get default font size */
95    if ( !chart->font_size)    if ( !chart->font_size)
96      chart->font_size = pl_fontsize_r(chart->lp, -1);      chart->font_size = pl_fontsize_r(chart->lp, -1);
# Line 105  chart_create(void) Line 101  chart_create(void)
101             chart->data_right, chart->data_top);             chart->data_right, chart->data_top);
102    
103    return chart;    return chart;
   
104  }  }
105    
   
   
106  /* Draw a tick mark at position  /* Draw a tick mark at position
107     If label is non zero, then print it at the tick mark     If label is non zero, then print it at the tick mark
108  */  */
# Line 188  void Line 181  void
181  chart_submit(struct chart *chart)  chart_submit(struct chart *chart)
182  {  {
183    struct som_entity s;    struct som_entity s;
184      struct outp_driver *d;
185    
186    if ( ! chart )    if ( ! chart )
187       return ;       return ;
# Line 208  chart_submit(struct chart *chart) Line 202  chart_submit(struct chart *chart)
202    
203    pl_deleteplparams(chart->pl_params);    pl_deleteplparams(chart->pl_params);
204    
205      d = outp_drivers (NULL);
206      d->class->finalise_chart(d, chart);
207    free(chart);    free(chart);
   
208  }  }
209    
210    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26