# Axis X is linked to the page zoom!

**URL:** <https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524>\
**Category:** Blazor WebAssembly\
**Created:** [November 28, 2021, 10:20am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524 "2021-11-28T10:20:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sbl](https://forum.radzen.com/user_avatar/forum.radzen.com/sbl/32/11947_2.png) [@Sbl](https://forum.radzen.com/u/Sbl)\
**Post date:** [November 28, 2021, 10:20am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/1 "2021-11-28T10:20:55Z")

</div>

Hi,  
I've made the bar chart and I don't understand why axis X is linked to the page zoom  
Zoom1

 ![Capture](https://forum.radzen.com/uploads/default/original/2X/7/7ea80e6065b415ebde0a5c3c45f4464228ca2601.png)  
Zoom2  
 ![Capture](https://forum.radzen.com/uploads/default/original/2X/5/58695a961c814ee3bca4fab568621059a3c243fa.png)

```auto
 <RadzenChart>
                        <RadzenColumnSeries Data="@graphSales" CategoryProperty="Month" ValueProperty="Revenue" LineType="LineType.Dashed" />
                                                <RadzenColumnOptions Radius="1" />
                        <RadzenCategoryAxis Padding="1" FormatString="{0:MMM}" />
                        <RadzenValueAxis>
                            <RadzenGridLines Visible="true" />
                            <RadzenAxisTitle Text="Quantité" />
                        </RadzenValueAxis>
 </RadzenChart>

```

How can I set the X axis to be independent of the page zoom?  
Thanks in advance to your support!

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [November 29, 2021, 6:51am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/2 "2021-11-29T06:51:18Z")

</div>

Indeed that's the default - Step is automatically calculated based on the chart width. You can set it to a fixed value however be aware that labels will overlap.

```auto
<RadzenCategoryAxis Padding="1" FormatString="{0:MMM}" Step="@TimeSpan.FromDays(28)" />
                        

```

---

<div class="post-metadata">

**Author:** ![Sbl](https://forum.radzen.com/user_avatar/forum.radzen.com/sbl/32/11947_2.png) [@Sbl](https://forum.radzen.com/u/Sbl)\
**Post date:** [November 29, 2021, 7:32am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/3 "2021-11-29T07:32:41Z")

</div>

Hi, I will try it.  
However, what do you means when you say :" however be aware that labels will overlap."  
This means that the label on x axis will overlaps, why?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [November 29, 2021, 8:11am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/4 "2021-11-29T08:11:23Z")

</div>

> [@Sbl](#):
>
> This means that the label on x axis will overlaps, why?

Because there will not be enough room for all of them.

---

<div class="post-metadata">

**Author:** ![Sbl](https://forum.radzen.com/user_avatar/forum.radzen.com/sbl/32/11947_2.png) [@Sbl](https://forum.radzen.com/u/Sbl)\
**Post date:** [November 29, 2021, 8:43am UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/5 "2021-11-29T08:43:54Z")

</div>

`Step="@TimeSpan.FromDays(28)"` makes the X-axis independent with the page zoom.  
How can I get enough space between them?

---

<div class="post-metadata">

**Author:** ![Sbl](https://forum.radzen.com/user_avatar/forum.radzen.com/sbl/32/11947_2.png) [@Sbl](https://forum.radzen.com/u/Sbl)\
**Post date:** [November 29, 2021, 8:05pm UTC](https://forum.radzen.com/t/axis-x-is-linked-to-the-page-zoom/9524/6 "2021-11-29T20:05:37Z")

</div>

Thank you to . I suggest the code below to solve my issue.  
It may be useful for others who have the same question.

```auto
public IActionResult RevenueByMonth()
        {
            var result = context.Developers
                                 .Where(opportunity => opportunity.Statut == "Closed")
                                 .Where(opportunity => opportunity.DateSolde >= new DateTime( _currentYear, 1, 1)
                                     && opportunity.DateSolde <= new DateTime( _currentYear, 12, 31))
                                .GroupBy(opportunity => opportunity.DateSolde.Month)
                                .OrderBy(opportunity => opportunity.Key)
                                .Select(group => new
                                 {
                                     Month = GetMonthAsText(group.Key, _currentYear),
                                     Revenue = group.Count(),
                                 })
                                 .ToList();
            return Ok(JsonSerializer.Serialize(result, new JsonSerializerOptions
            {
                PropertyNamingPolicy = null
            }));
        }

```

```auto
  private static string GetMonthAsText(int month, int year)
        {
            return month switch
            {
                1 => $"January {year}",
                2 => $"February {year}",
                3 => $"March {year}",
                4 => $"April {year}",
                5 => $"May {year}",
                6 => $"June {year}",
                7 => $"July {year}",
                8 => $"August {year}",
                9 => $"September {year}",
                10 => $"October {year}",
                11 => $"November {year}",
                12 => $"December {year}",
                _ => throw new NotImplementedException(),
            };
        }

```

The above code refers to : [link](https://www.claudiobernasconi.ch/2021/04/23/building-a-dashboard-blazor/)
