Page 1 of 1

graphic of shelves

Posted: Fri Apr 17, 2009 2:19 pm
by 13051613
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

Posted: Fri Apr 17, 2009 2:35 pm
by narcis
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!

Posted: Fri Apr 17, 2009 4:01 pm
by 13051613
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

Posted: Mon Apr 20, 2009 9:32 am
by yeray
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.

Posted: Thu Apr 23, 2009 8:40 am
by 13051613
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.

Posted: Thu Apr 23, 2009 10:36 am
by 13051613
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

Posted: Fri May 22, 2009 9:07 am
by 13051613
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

Posted: Fri May 22, 2009 10:11 am
by yeray
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

Posted: Tue May 26, 2009 8:14 am
by 13051613
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.

Posted: Wed May 27, 2009 2:01 pm
by yeray
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.