Comments (7)
@IgorLelyakov
It seems that there is a discrepancy between the expected keys and provided ones, I would suggest using the camel case as shown in documentation. Below is the fixed example of your data.
{
"id": "1",
"parent": "null",
"name": "Проект 1",
"baselineStart": "2023-02-01",
"baselineEnd": "2023-12-21",
"actualStart": "2023-02-05",
"actualEnd": "2023-12-31",
"progressValue": "50",
"connectTo": "null",
"connectorType": "null"
},
To have custom column display the baselineStart
you just need to fallow the documentation on formatters and use newColumn2.labels().format('{%baselineStart}')
Thank you for your question, if any other questions will come up, don't hesitate to ask, I'm here to help.
from anychart.
Добрый день!
Спасибо за ответ, заменил как вы предложили.
Выдает следующую ошибку:
File "d:\Python\Projects1\templates\gant3.html", line 31, in template
newColumn2.labels().format('{%baselineStart}');
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'baselineStart'.
//var gant = anychart.fromJson({{chartData|safe}});
var gant = {{ chartData|tojson|safe }};
console.log('gant:', gant);
var treeData = anychart.data.tree(gant, 'as-table');
console.log('treeData:', treeData);
var chart = anychart.ganttProject();
// set data for the chart
chart.data(treeData);
var newColumn2 = chart.dataGrid().column(2);
newColumn2.labels().format('{%baselineStart}');
chart.container("container");
// initiate drawing the chart
chart.draw();
chart.edit(true);
});
</script>
from anychart.
@IgorLelyakov
I've put together a working sample for you. It seem that something interferes with normal behaviour of the chart, could you try removing any additional libraries and re-testing.
Thank you for your question, if any other questions will come up, don't hesitate to ask, I'm here to help.
from anychart.
Спасибо за ответ, да действительно влияет на поведение графика и ошибку, то что я использую библиотеку flask python и оператор render_template. В ней используется шаблонизатор Jinja2, в котором команды обычно обрамляются символами {%....%} ( в начале и в конце команды) и поэтому выдается ошибка, скажите можно ли по другому использовать оператор newColumn2.labels().format('{%baselineStart}'), есть ли другой способ вывода колонки или мне надо не использовать flask python?
from anychart.
@IgorLelyakov
I've never used Jinja2, but it seems that the syntax configuration there could be adjusted to your case as an example from {% foo %}
to <% foo %>
. Additionally I could recommend you testing some ways to devide the whole string into pieces:
var baselineStart = "%baselineStart"
newColumn2.labels().format('{'+baselineStart+'}');
from anychart.
Огромное спасибо, все получилось
from anychart.
Thank you for your question, if any other questions will come up, don't hesitate to ask, I'm here to help.
from anychart.
Related Issues (20)
- Theme related issue in sparkline chart.
- Не отображается контекстное меню HOT 2
- Не загружается Gantt From JSON HOT 2
- Anychart Map throwing runtime error when clicked on zoomed in state HOT 2
- 405 (METHOD NOT ALLOWED) при выполнении POST
- need better documentation
- AnyChartView doesnot show at all in UI HOT 1
- Как получить при нажатии кнопки мыши на запись в таблице в диаграмме ганта значения всех полей выбранной записи в виде массива? HOT 7
- Labels being cut off if they are positioned on the first and last point on my line chart HOT 2
- `zoomOnMouseWheel` missing from type definition for `Interactivity` HOT 1
- В режиме редактирования не отображаются в data grid новые введенные значения полей actualStart, actualEnd, baselineStart, baselineEnd, progress, parent HOT 3
- Не возможно на сайте войти в документацию General User's Guide, JavaScript API Reference и другие .... HOT 1
- как установить горизонтальный скроллер в диаграмме ганта? HOT 3
- Можно ли использовать одновременно горизонтальный скроллер и toolbar HOT 2
- Проблема с подключением календаря HOT 4
- Событие "row MouseUp" срабатывает 2 раза, как различить 1-е и 2-е событие HOT 2
- Как получить даты начала и окончания родительских задач HOT 1
- В chart.listen("connectorSelect"...) дублируется операция удаления разъема HOT 2
- Можно ли скрыть график и оставить только табличную часть на диаграмме ганта? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anychart.