At present I am able to represent on a Chart showing all Electricity invoices for a site and as the next site is selected the chart shows invoices particular to that site. I used and changed the Alphasports open Barchart sample xbasic to accomplish this.
What I really require to do is filter the selection to show only the invoices for a selected 12 months and using these values set a target line graph, say 15% reduced values and then as the present years invoice information is input it is set against the those to measure present performance.
Could anyone provide any light on how this may be achieved?
If not so could anyone even suggest how I can limit the invoices shown on the graph to those that I really require seeing ie 12 months.
The set up is site table to invoice table in one to many relationship
Thank You
Robert
What I really require to do is filter the selection to show only the invoices for a selected 12 months and using these values set a target line graph, say 15% reduced values and then as the present years invoice information is input it is set against the those to measure present performance.
Could anyone provide any light on how this may be achieved?
If not so could anyone even suggest how I can limit the invoices shown on the graph to those that I really require seeing ie 12 months.
The set up is site table to invoice table in one to many relationship
Thank You
Robert
Code:
dim SiteID as c = default "" dim invoice_list as c as p dim chartGen as p dim month as c dim units as n dim c as ColorDefinition c.name = "Win3D" SiteID = Site_data->Site_idf invoice_list = set.external_record_content_get("site_invoiceset","site_invoice_data->monthf + '|' + site_invoice_data->unitsperday","","Site_idf=" + SiteID + "") chartGen = activex1.activex.this chartGen.DataSeries.Clear() 'chartGen.PieLabelMode = 1 'scPieLabelModeInside 'chartGen.LegendPos = 3 'scLegendPosBottom 'chartGen.BackColor = c.RGB_Value 'chartGen.BorderColor = c.RGB_Value 'chartGen.Caption = "Kwh units used by Month" chartGen.DataSeries.AddBarSeries("Units used",0) for each invoice in invoice_list month = alltrim(word(invoice.value,1,"|")) units = val(word(invoice.value,2,"|")) month = Month + " - " + units chartGen.DataSeries(1).SeriesData.Add(month,units,0) 'scFillModeAutoSolid) next ChartGen.Refresh()
Comment