To modify Characteristics of the Graphs.

Hello.

We are testing the Fast Report to check if it is useful for us.

Visual BAsic Code

I need to generate graphs by code, but there are many properties that do not can modified.
The size of the graph (Width,Height), the format of data (formatValue).
It is necessary to create an object in particular within the TfrxChartView.
From the FastReport is can to modify properties, but by code i do not know to do it.

CODE:
Dim Grafica As IfrxChartView
Set Grafica = report.CreateReportObjectEx(page, "TfrxChartView", "Char_View1")
Set database = report.CreateReportObjectEx(page, "TfrxADODatabase", "Database")
Set sql_query = report.CreateReportObjectEx(page, "TfrxADOQuery", "SQL_Query1")
report.SelectDataset True, sql_query
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).XAxisType = xtNumber
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).DataSet = sql_query
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).Title = "Grafica"
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).DataSet.ValueOfField ("TITULAR")
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).XSource = "sql_query1.""TITULAR"""
Grafica.GetSeriesItem(Grafica.SeriesCount - 1).YSource = "sql_query1.""Importe"""


Thanks

Comments

  • edited 9:57PM
    Alfredo wrote: »
    I need to generate graphs by code, but there are many properties that do not can modified.
    The size of the graph (Width,Height), the format of data (formatValue).
    It is necessary to create an object in particular within the TfrxChartView.
    From the FastReport is can to modify properties, but by code i do not know to do it.

    CODE:
    Dim Grafica As IfrxChartView
    Set Grafica = report.CreateReportObjectEx(page, "TfrxChartView", "Char_View1")
    Set database = report.CreateReportObjectEx(page, "TfrxADODatabase", "Database")
    Set sql_query = report.CreateReportObjectEx(page, "TfrxADOQuery", "SQL_Query1")
    report.SelectDataset True, sql_query
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).XAxisType = xtNumber
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).DataSet = sql_query
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).Title = "Grafica"
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).DataSet.ValueOfField ("TITULAR")
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).XSource = "sql_query1.""TITULAR"""
    Grafica.GetSeriesItem(Grafica.SeriesCount - 1).YSource = "sql_query1.""Importe"""

    Actually, TfrxChartView built on top of TeeChart library that provides huge amout of different properties. We export some of then into IfrxChartView and accompanying interfaces.

    To set the size of graph you can cast IfrxChartView to IfrxComponent and set Width and Height properties.

    Unfortunately, there is no way to set the formatValue at this time. We consider to add such feature after release of FR Studio 4.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.