RE: [Zope] ZGDChart product...

2000-11-14 Thread Furbach, Andreas

Hello.

The function _chartdata in ZGDchart.py returns only one label column and one
data column. 
You may want to change this to:
*

def _chartdata(self):
"""
return the first and second columns of sql query
results as a pair of tuples
"""
rows = getattr(self, self.SQL)()
# data[0] is list of labels
data =  []
start = 0
for row in rows:
# each row is a list of fields
# initialize empty lists for each column
if start == 0:
  start = 1
  for i in range(len(row)):
data.append([])
#
# Only insert rows with zero values if
# it is not a pie chart
# Pie Chart only makes sense with 1 data column
#
for i in range(len(row)):
if (self.REQUEST['zgdchart_runtime_type'] !=
GDC_3DPIE and self.REQUEST['zgdchart_runtime_type'] != GDC_2DPIE) or row[1]
!= 0:
  #
  # Coerce the first field into a string
  # and other fields into a float
  #
  if i == 0:
  data[i].append( str  (row[i]))
  else:
  data[i].append( float(row[i]))
#
# convert lists to tuples
# apparently, gdchart.chart() accepts lists
# as well, but I better check with
# M Steed first.
#
# I just tried.
return data


***

and restart Zope, which worked for me.

Andreas Furbach
___
EDS Informationstechnologie und Service GmbH
Semerteichstr. 50-52
D-44141 Dortmund

Tel.: 0231 / 944-1533
mailto: [EMAIL PROTECTED]

Hi.

This is really a great product.

Unfortunately, I'm not able to create a chart with multiple columns using a

ZSQL Data Method.
Multiple columns with a DTML-Method works fine.

Do I miss something. Any ideas?

Thanks for any help. Regards, Marc Ludwig ([EMAIL PROTECTED])

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZGDChart product...

2000-10-24 Thread zope

Hi.

This is really a great product.

Unfortunately, I'm not able to create a chart with multiple columns using a 
ZSQL Data Method.
Multiple columns with a DTML-Method works fine.

Do I miss something. Any ideas?

Thanks for any help. Regards, Marc Ludwig ([EMAIL PROTECTED])


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )