graphic of shelves

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

graphic of shelves

Post by Pujol1986 » Fri Apr 17, 2009 2:19 pm

Hello!

I have a question about what is the better kind of chart to do this task.

I have to do a graphic based on the shelves in a store.

for example, I have this shelve:

Image
By pujol1986 at 2009-04-17

the green squares means that this block of the shelve is completely empty
the orange squares means that this block is not completely empty
the brown squares means that the block is fully occupied

i need to draw this shelve using teechart .net and i don't know what kind of graphic will be the better option.

I think that maybe i can do this chart using the point graphic.

what do you think about this?
what would be the better option to do this task? (if it's possible to do with teechart .net)

if you don't understand something about what i have to do, please ask me about your doubt

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 17, 2009 2:35 pm

Hi Pujol1986,

For that I recommend you to use ColorGrid series setting its IrregularGrid property to true. Here I described how this kind of series work.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Fri Apr 17, 2009 4:01 pm

Hello,

Now i know that it's posible to do my task with teechart .net

now i have a few questions:

it's posible to have blocs with diferent sizes on the same shelve like in the picture below?

Image
By pujol1986 at 2009-04-17

it's posible to see multiple shelves with this kind of chart?
for example, i have a store with multiple shelves one behind another. Can i show this on a chart and see the shelves like in the picture below?

Image
By pujol1986 at 2009-04-17

if it's not posible to see the shelves like in this picture.

what kind of chart i have to use to show a map of the store with the situation of the shelves? (when i do click on one shelve, i would like to see the ColorGrid series of this shelve)

there is a picture of how the map should be:

Image
By pujol1986 at 2009-04-17


thanks in advance

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Apr 20, 2009 9:32 am

Hi Pujol1986,

1 and 2. ColorGrids series is the series more similar series than what I think you are trying to achieve. But it wasn't thought to draw a graphic like yours so there will be some limitations to do this.

The first limitation will be the depth. ColorGrid series has no volume in depth.

The second is the irregularity. If you have an irregular grid, you'll have an extra cell drawn in the right that will have the same width than the last. That means that if you want some cells different in size than the others, it can't be the last nor the penultimate.

Here there is a "simple" example:

Code: Select all

 tChart1.Aspect.Chart3DPercent = 50;
            tChart1.Legend.Visible = false;

            for (int i = 0; i < 3; i++)
            {
                ColorGrid colorgrid1 = new ColorGrid(tChart1.Chart);
                colorgrid1.IrregularGrid = true;

                colorgrid1.Add(0, 0, 0);
                colorgrid1.Add(0, 1, 1);
                colorgrid1.Add(0, 0, 2);
                colorgrid1.Add(0, 2, 3);

                colorgrid1.Add(1, 1, 0);
                colorgrid1.Add(1, 0, 1);
                colorgrid1.Add(1, 2, 2);
                colorgrid1.Add(1, 1, 3);

                colorgrid1.Add(2, 0, 0);
                colorgrid1.Add(2, 2, 1);
                colorgrid1.Add(2, 2, 2);
                colorgrid1.Add(2, 0, 3);

                colorgrid1.Add(3.5, 1, 0);
                colorgrid1.Add(3.5, 0, 1);
                colorgrid1.Add(3.5, 2, 2);
                colorgrid1.Add(3.5, 0, 3);

                colorgrid1.Add(4.5, 0, 0);
                colorgrid1.Add(4.5, 1, 1);
                colorgrid1.Add(4.5, 2, 2);
                colorgrid1.Add(4.5, 0, 3);


                ColorGrid colorgrid2 = new ColorGrid(tChart1.Chart);
                colorgrid2.IrregularGrid = true;

                colorgrid2.Add(0, 0, 0);
                colorgrid2.Add(0, 1, 0.25);
                colorgrid2.Add(0, 2, 0.5);
                colorgrid2.Add(0, 0, 0.75);

                colorgrid2.Add(0.2, 1, 0);
                colorgrid2.Add(0.2, 2, 0.25);
                colorgrid2.Add(0.2, 0, 0.5);
                colorgrid2.Add(0.2, 1, 0.75);

                colorgrid2.Add(0.5, 1, 0);
                colorgrid2.Add(0.5, 0, 0.25);
                colorgrid2.Add(0.5, 1, 0.5);
                colorgrid2.Add(0.5, 2, 0.75);

                colorgrid2.Add(0.75, 2, 0);
                colorgrid2.Add(0.75, 2, 0.25);
                colorgrid2.Add(0.75, 0, 0.5);
                colorgrid2.Add(0.75, 1, 0.75);

                ColorGrid colorgrid3 = new ColorGrid(tChart1.Chart);
                colorgrid3.IrregularGrid = true;

                colorgrid3.Add(2, 0, 3);
                colorgrid3.Add(2, 1, 3.25);
                colorgrid3.Add(2, 0, 3.5);
                colorgrid3.Add(2, 2, 3.75);

                colorgrid3.Add(2.2, 2, 3);
                colorgrid3.Add(2.2, 2, 3.25);
                colorgrid3.Add(2.2, 0, 3.5);
                colorgrid3.Add(2.2, 1, 3.75);

                colorgrid3.Add(2.5, 2, 3);
                colorgrid3.Add(2.5, 0, 3.25);
                colorgrid3.Add(2.5, 1, 3.5);
                colorgrid3.Add(2.5, 0, 3.75);

                colorgrid3.Add(3, 1, 3);
                colorgrid3.Add(3, 2, 3.25);
                colorgrid3.Add(3, 0, 3.5);
                colorgrid3.Add(3, 1, 3.75);                

                colorgrid1.ZOrder = i+1;
                colorgrid2.ZOrder = i+1;
                colorgrid3.ZOrder = i+1;
            }

            tChart1.Axes.Bottom.SetMinMax(0, 5.5);
3. The easiest way to achieve this, probably is using gantt series. Something like following:

Code: Select all

            tChart1.Aspect.View3D = false;
            Gantt gantt1= new Gantt(tChart1.Chart);
            gantt1.XValues.DateTime = false;

            gantt1.Add(0,10,0);
            gantt1.Add(15, 20, 0);
            gantt1.Add(30, 33, 0);

            gantt1.Add(0, 20, 1);

            gantt1.Add(5, 10, 2);
            gantt1.Add(12, 15, 2);
            gantt1.Add(20, 30, 2);

            gantt1.Add(3, 8, 3);
            gantt1.Add(13, 25, 3);
            gantt1.Add(27, 35, 3);
Also, you could use map series to create your custom polygons.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Thu Apr 23, 2009 8:40 am

Hello again,

I have tested a simple runtime examples of colorgrids series and map series and i finally decide to do this using the map series.

Well, i was looking for an example in VB.Net to see how i can draw a polygon in the map using my own properties (color, position and shape)

I'm very interested on the sape of the polygon.

where i can find examples of this? i have found examples on .Net but not in VB.net, and the examples are not complete, only i can see a part of the code.

Thanks in advance.

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Thu Apr 23, 2009 10:36 am

Hi, i have wrote this code and it works:

Code: Select all


        Dim AX() As Integer = {1, 7, 7, 1}
        Dim AY() As Integer = {1, 1, 7, 7}
        Dim Colors() As Color = {Color.Lime}
        Map1.AddShape(AX, AY, "color")

now i can continue with my app

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Fri May 22, 2009 9:07 am

Hello again, I'm having problems to load the shelves on the map automaticaly.

Firstly, I do a Select count(*) from a table of Oracle to know how many shelves I must draw in the map.

I'm using this code to add shelves on the map:

Code: Select all

        Dim i As Integer = 1
        Dim AX() As Integer = {2, 1, 1, 2}
        Dim AY() As Integer = {i, i, i + 1, i + 1}

        i = i + 2

        Dim BX() As Integer = {2, 1, 1, 2}
        Dim BY() As Integer = {i, i, i + 1, i + 1}

        i = i + 2

        Dim CX() As Integer = {2, 1, 1, 2}
        Dim CY() As Integer = {i, i, i + 1, i + 1}

        Map1.AddShape(AX, AY, "A")
        Map1.AddShape(BX, BY, "B")
        Map1.AddShape(CX, CY, "C")
This is not the best way to add shapes on the map series, because I need to know how many shelves are in the tabla of Oracle and then write the code.

How I can do to draw the shelves using a simple 'while' or 'for' iteration?
(remember that I know how many shelves I must draw on the map using the Select count(*) statement)

Thanks in advance

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri May 22, 2009 10:11 am

Hi Pujol,

What about this?

Code: Select all

For i As Integer = 1 To 3
    Dim X() As Integer = {2, 1, 1, 2}
    Dim Y() As Integer = {i * 2 - 1, i * 2 - 1, i * 2, i * 2}
    Map1.AddShape(X, Y, "")
Next i
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Tue May 26, 2009 8:14 am

Thanks yeray, it works.

I have another question, how I can take the data from my Oracle DB?

I have the following screen:
Image

Then I have to choose a Dataset...
What kind of values I need to have in my field of the table?
for example... in labels I need to have a Varchar2 (String value) 'Etiqueta 1'
but I don't know the type of the field and the format of the data that I need to put in the other fields of the table.

can you give me an example of the other fields?

Thanks in advance.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed May 27, 2009 2:01 pm

Hi Pujol,

Here you have instructions written by Narcis. You could also find more instructions in Tutorial8 - ADO.NET Database Access.

Both X and Y values should be doubles, integers or datetimes.

PS: And please, for different questions, try to open different forum topics in order to maintain the forums organized.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply