Results 1 to 9 of 9

Thread: [CLOSED] NumericAxis Chart

  1. #1
    Premium Member
    Join Date
    Jul 2010
    Location
    Brazil
    Posts
    123

    [CLOSED] NumericAxis Chart

    Hi,

    I have the following structure defined for my graph:

    Chart:
    Code:
    <ext:Chart ID="chtGrafico" runat="server"  Legend="true"
        Animate="true" Width="800" Height="500" Frame="true">
        <LegendConfig Position="Bottom" />
        <Store>
            <ext:Store ID="StoreGrafico" runat="server">
                <Model>
                    <ext:Model runat="server">
                        <Fields>
                            <ext:ModelField Name="Legenda" Mapping="Legenda" />
                            <ext:ModelField Name="Saldo Total" Mapping="ValorSaldo" />
                            <ext:ModelField Name="Provisão" Mapping="ValorProvisao" />
                            <ext:ModelField Name="Principal" Mapping="ValorPrincipal" />
                            <ext:ModelField Name="Rendas Apropriar" Mapping="ValorRAP" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
        </Store>
        <Axes>
            <ext:NumericAxis Fields="Provisão,Rendas Apropriar,Principal,Saldo Total" Title="Valor"
                Minimum="0" Grid="true" MajorTickSteps="25">
                <GridConfig>
                    <Odd Opacity="1" Fill="#ddd" Stroke="#bbb" StrokeWidth="1" />
                </GridConfig>
                <Label>
                    <Renderer Fn="lblRendererLateral" />
                </Label>
            </ext:NumericAxis>
            <ext:CategoryAxis Position="Bottom" Fields="Legenda" Title="PerÃ*odo" Grid="true">
                <Label>
                    <Rotate Degrees="350" />
                </Label>
            </ext:CategoryAxis>
        </Axes>
        <Series>
            <ext:AreaSeries Axis="Left" XField="Legenda" YField="Provisão,Rendas Apropriar,Principal,Saldo Total"
                Highlight="true">
                <Style Opacity="0.93" StrokeWidth="1" Stroke="#666" />
                <Tips runat="server" TrackMouse="true" Width="190" Height="35">
                    <Renderer Fn="tipRenderer" />
                </Tips>
            </ext:AreaSeries>
        </Series>
    </ext:Chart>
    JS:
    Code:
    function tipRenderer(storeItem, item) {
        this.setTitle(item.storeField + ' - ' + storeItem.get('Legenda') + '<br />' + MaskMoeda(storeItem.get(item.storeField)).replace('R$', 'R$ '));
    };
    function lblRendererLateral(storeItem) {
        return MaskMoeda(storeItem).replace('R$', 'R$ ');
    };
    It's working perfectly, follows the graph:
    Click image for larger version. 

Name:	Grafico.png 
Views:	91 
Size:	49.5 KB 
ID:	4565

    My biggest value is the print (R$ 2.001.831,34), but from what I understand, it makes a summation of all. I would like to set the maximum value for the graph the most return from my database.

    Thanks,
    Last edited by Daniil; Aug 07, 2012 at 4:58 AM. Reason: [CLOSED]

  2. #2
    Ext.NET - Support Team Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    27,454
    Hi,

    Quote Originally Posted by pdcase View Post
    My biggest value is the print (R$ 2.001.831,34), but from what I understand, it makes a summation of all. I would like to set the maximum value for the graph the most return from my database.
    Please clarify where do you need to see "the maximum value from the database"? In the ToolTip or as a max value of the NumericAxis?
    Daniil
    Ext.NET, Inc.
    Support Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | Twitter | Jobs

  3. #3
    Premium Member
    Join Date
    Jul 2010
    Location
    Brazil
    Posts
    123
    Hi,

    I need the max value in the NumericAxis, my ToolTip is correct, it's show this max value, but it displays the sum in NumericAxis.

    Thanks.

  4. #4
    Ext.NET - Support Team Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    27,454
    I don't understand how it should look.

    it makes a summation of all
    Yes, exactly, but how else? Then the chart should show only one series with that maximum value.
    Daniil
    Ext.NET, Inc.
    Support Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | Twitter | Jobs

  5. #5
    Premium Member
    Join Date
    Jul 2010
    Location
    Brazil
    Posts
    123
    Hi,

    I have the follow table:
    Id Date Value1 Value2 Value3 Value4
    1 30/06/2012 10 20 30 40
    2 31/07/2012 10 20 30 40
    3 31/08/2012 10 20 30 40
    4 30/09/2012 10 20 30 40
    5 31/10/2012 10 20 30 40
    6 30/11/2012 10 20 30 40

    The sum of the columns:
    Value1: 60
    Value2: 120
    Value3: 180
    Value4: 240

    I would like to show, only the biggest value of this 4 column, in other words, 240, not the sum of all this 4 column in this case 600.

    Thanks.

  6. #6
    Ext.NET - Support Team Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    27,454
    Well, then you have to break
    Code:
    YField="Provisão,Rendas Apropriar,Principal,Saldo Total"
    up to four separate AreaSeries.

    But they will be overlapped.

    Another approach is using LineSeries.
    http://examples.ext.net/#/Chart/Line/Basic/
    Daniil
    Ext.NET, Inc.
    Support Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | Twitter | Jobs

  7. #7
    Premium Member
    Join Date
    Jul 2010
    Location
    Brazil
    Posts
    123
    Hi,

    I separated my AreaSeries, created four, but the color is confusing, this way the max value in NumericAxis is correct.

    The Tips was also confusing.

    New AreaSeries:
    Code:
    <Series>
        <ext:AreaSeries Axis="Left" XField="Legenda" YField="Provisão"
            Highlight="true">
            <Style Opacity="0.93" StrokeWidth="1" Stroke="#666" />
            <Tips runat="server" TrackMouse="true" Width="190" Height="35">
                <Renderer Fn="tipRenderer" />
            </Tips>
        </ext:AreaSeries>
        <ext:AreaSeries Axis="Left" XField="Legenda" YField="Rendas Apropriar"
            Highlight="true">
            <Style Opacity="0.93" StrokeWidth="1" Stroke="#666" />
            <Tips ID="Tips1" runat="server" TrackMouse="true" Width="190" Height="35">
                <Renderer Fn="tipRenderer" />
            </Tips>
        </ext:AreaSeries>
        <ext:AreaSeries Axis="Left" XField="Legenda" YField="Principal"
            Highlight="true">
            <Style Opacity="0.93" StrokeWidth="1" Stroke="#666" />
            <Tips ID="Tips2" runat="server" TrackMouse="true" Width="190" Height="35">
                <Renderer Fn="tipRenderer" />
            </Tips>
        </ext:AreaSeries>
        <ext:AreaSeries Axis="Left" XField="Legenda" YField="Saldo Total"
            Highlight="true">
            <Style Opacity="0.93" StrokeWidth="1" Stroke="#666" />
            <Tips ID="Tips3" runat="server" TrackMouse="true" Width="190" Height="35">
                <Renderer Fn="tipRenderer" />
            </Tips>
        </ext:AreaSeries>
    </Series>
    Print:
    Click image for larger version. 

Name:	Grafico1.png 
Views:	4 
Size:	32.5 KB 
ID:	4571

    There is the possibility of each AreaSeries have your color and adjust the Tips?

    Thanks.

  8. #8
    Ext.NET - Support Team Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    27,454
    Anyways, they will overlap each other.

    I think you should switch to LineSeries.
    Daniil
    Ext.NET, Inc.
    Support Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | Twitter | Jobs

  9. #9
    Premium Member
    Join Date
    Jul 2010
    Location
    Brazil
    Posts
    123
    I'll try to switch to LineSeries.

    Thanks.

Similar Threads

  1. [OPEN] [#93] NumericAxis labels rendered incorrectly
    By Stijn in forum 2.x Premium Help
    Replies: 4
    Last Post: Dec 27, 2012, 5:44 AM
  2. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  3. [CLOSED] maximum for numericaxis in charts only allows integer
    By CarpFisher in forum 2.x Premium Help
    Replies: 3
    Last Post: Jun 29, 2012, 2:57 PM
  4. Replies: 1
    Last Post: Jun 02, 2012, 7:12 AM
  5. [CLOSED] Chart Ext.Net
    By Jurke in forum 1.x Premium Help
    Replies: 4
    Last Post: Mar 01, 2011, 7:02 AM

Posting Permissions