# Setting Tickvals and Ticktext after loading data (plotly.blazor / plotly.NET)

**URL:** <https://community.plotly.com/t/setting-tickvals-and-ticktext-after-loading-data-plotly-blazor-plotly-net/92320>\
**Category:** Plotly R, MATLAB, Julia, Net\
**Created:** [May 15, 2025, 11:42pm UTC](https://community.plotly.com/t/setting-tickvals-and-ticktext-after-loading-data-plotly-blazor-plotly-net/92320 "2025-05-15T23:42:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_Waterston](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/will_waterston/32/31549_2.png) [@Will\_Waterston](https://community.plotly.com/u/Will_Waterston)\
**Post date:** [May 15, 2025, 11:42pm UTC](https://community.plotly.com/t/setting-tickvals-and-ticktext-after-loading-data-plotly-blazor-plotly-net/92320/1 "2025-05-15T23:42:56Z")

</div>

Hi, I’m having trouble setting tickvals and ticktext dynamically depending on the traces that are loaded in a 3D Surface chart.

The below code in my Layout declaration works as expected, but its set at compile time -

```
        layoutRibbon = new Layout {
                // Title and other declarations,
                Scene = new[] {
                    new Scene {
                        YAxis = new YAxis { Title = new Plotly.Blazor.LayoutLib.SceneLib.YAxisLib.Title { Text = "Date/Time" } },
                        ZAxis = new ZAxis { Title = new Plotly.Blazor.LayoutLib.SceneLib.ZAxisLib.Title { Text = "Fuel Level" } },
                        XAxis = new XAxis { Title = new Plotly.Blazor.LayoutLib.SceneLib.XAxisLib.Title { Text = "Machine" },
                                            TickMode = Plotly.Blazor.LayoutLib.SceneLib.XAxisLib.TickModeEnum.Array,
                                            TickVals = new List<object> { 0,1,2 },
                                            TickText = new List<object> { "text 1", "text 2" , "text 3" }
                                          },
                    }
                },

```

I’m trying to achieve the same result but at runtime. I’ve tried declaring like this

```
                                            TickVals = new List<object>(),
                                            TickText = new List<object>()

```

and then at runtime I do this

```
        layoutRibbon.Scene[0].XAxis.TickVals.Add(0);
        layoutRibbon.Scene[0].XAxis.TickVals.Add(1);
        layoutRibbon.Scene[0].XAxis.TickVals.Add(2);
        layoutRibbon.Scene[0].XAxis.TickText.Add("text 0");
        layoutRibbon.Scene[0].XAxis.TickText.Add("text 1");
        layoutRibbon.Scene[0].XAxis.TickText.Add("text 2");

```

but my ticktext is entirely blank.

Can someone show me the correct way to do this?

Thanks

---

<div class="post-metadata">

**Author:** ![Will\_Waterston](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/will_waterston/32/31549_2.png) [@Will\_Waterston](https://community.plotly.com/u/Will_Waterston)\
**Post date:** [May 17, 2025, 5:11am UTC](https://community.plotly.com/t/setting-tickvals-and-ticktext-after-loading-data-plotly-blazor-plotly-net/92320/2 "2025-05-17T05:11:56Z")

</div>

discovered that what I’ve done there is actually correct, all I needed was a chat.Relayout() to redraw the axis after modification.
