3 Replies Latest reply on Nov 11, 2010 6:40 PM by hengic

    How to display minor tick marks for DateTimeAxis?

    Sharky2k6 Level 1

      I created a datetime axis with the following:

                                   id="myAxis"

                                   dataUnits="seconds"
                                  labelUnits="seconds"
                                  interval="30"
                                  minorTickInterval="10"
                                  minorTickUnits="seconds"

       

       

      Next I created an axis renderer with the following:

          <mx:AxisRenderer
                              axis="{myAxis}"

                               tickPlacement="outside"

                               tickLength="5" minorTickPlacement="outside"

                               minorTickLength="5"/>

       

       

      Despite this, it only shows major tickmarks (with labels) every 30 seconds.  Does anyone know why Flex is ignoring minorTickInterval or is this a bug?

       

      Any help would be much appreciated, thanks!

        • 1. Re: How to display minor tick marks for DateTimeAxis?
          dgeurts11 Level 1

          Odd I have been struggling with the same problem for a couple hours.... ill post back if I find a solution :'(

          • 2. Re: How to display minor tick marks for DateTimeAxis?
            mjschiavone Level 1

            I was able to see the minor ticks by using the style minorTickPlacement on the AxisRenderer.  As I'm doing this dynamically based on the chart display, I used:

            xAxisRenderer.setStyle("minorTickPlacement", "cross");

             

            You can simply define this in the style definition for your axis renderer.  This would be more simple and elegant, as long as your ticks aren't dynamically displayed.

             

            My only problem now: I can't see the minor tick labels.  Has anyone had any luck on this? 

            • 3. Re: How to display minor tick marks for DateTimeAxis?
              hengic Level 1

              I encounter the same problem. good luck. I find the solution.

              The style of minorTickStroke of AxisRenderer is none by default. So, you have to add a stroke to it.

              <mx:AxisRenderer
                                      axis="{myAxis}"

                                       tickPlacement="outside"

                                       tickLength="5" minorTickPlacement="outside"

                                       minorTickLength="5">

                   <mx:minorTickStroke>

                        <mx:Stroke color="0xff0000" weight="2"/>

                   </mx:minorTickStroke>

              </mx:AxisRenderer>

               

              Hope it can help you.